I am trying to re-do my asp pages into asp.net through Web Matrix. I currently have a function that is called "CreateDBConn()". This functions contains the following. <BR><BR>"Function CreateDBConn() <BR><BR><BR>Set Conn = Server.CreateObject("ADODB.Connection") <BR>Conn.Open "Provider=SQLOLEDB.1;User ID=sa;Password=;Initial Catalog=OldMastInc;Data Source=StationNum111;" <BR><BR>&#039;"DSN=OMPMaster" & _ <BR>&#039;"Uid=sa;" & _ <BR>&#039;"Password=;" <BR>&#039;"Uid=;" & _ <BR>&#039;"Pwd=;" <BR>&#039;"DSN=OMPMaster" & _ <BR><BR><BR>&#039;Dim rst <BR>&#039;Dim strConnect <BR>&#039;Dim cnn <BR><BR>&#039;strConnect = "DSN=ArenasDB" <BR>&#039;Set cnn = server.CreateObject("ADODB.Connection") <BR>&#039;Set rst = Server.CreateObject("ADODB.Recordset") <BR>&#039;cnn.Open strConnect <BR>Set CreateDBConn = Conn <BR>End Function" <BR><BR>When I try to use this code in .net I get this error. <BR><BR>"Compiler Error Message: BC30289: Statement cannot appear within a method body. End of method assumed." <BR><BR>The line it is on is this one. <BR><BR>"Function CreateDBConn()" <BR><BR>I am really new to .net and I assume that I can not either create functions like this, or if there is something else that needs to be added. <BR><BR>Any help would be great. <BR><BR>Thank you, <BR><BR>Keith