Z
Zak
I've been working on converting one of the major sites in my company to ASP.
net. I started with the migration assistant from Microsoft, which may or may
not have been a good idea. It worked OK on the last conversion though.
In trying to develop good coding practices, I'm using Option Strict. When I
made my last conversion, I wrote a relatively simple function where you
passed in an SQL string, and it returned an SqlDataReader. Worked great on
that site, but on this one I get the following error:
Compiler Error Message: BC30451: Name 'OpenRDR' is not declared.
Source Error:
Line 85: Dim sql as String = "SELECT * FROM All_Schools WHERE
TeamName='FRONT'"
Line 86: rdr = OpenRDR(sql)
Here is the dbsupport file as it currently is.
<script language="VB" runat="Server">
function OpenRDR(ByRef sql As String) As SqlDataReader
Dim Conn As SqlConnection = new SqlConnection(ConfigurationSettings.
AppSettings("ConnectionString"))
Dim dbComm As SqlCommand = new SqlCommand(sql,conn)
Dim rs As SqlDataReader
Conn.Open()
rs = dbComm.ExecuteReader(CommandBehavior.CloseConnection)
return rs
end function
</script>
Have I missed something in all my reading? I've only been at .NET for about
a week and a half, but I never saw anything like this in ASP. Any ideas are
welcome.
net. I started with the migration assistant from Microsoft, which may or may
not have been a good idea. It worked OK on the last conversion though.
In trying to develop good coding practices, I'm using Option Strict. When I
made my last conversion, I wrote a relatively simple function where you
passed in an SQL string, and it returned an SqlDataReader. Worked great on
that site, but on this one I get the following error:
Compiler Error Message: BC30451: Name 'OpenRDR' is not declared.
Source Error:
Line 85: Dim sql as String = "SELECT * FROM All_Schools WHERE
TeamName='FRONT'"
Line 86: rdr = OpenRDR(sql)
Here is the dbsupport file as it currently is.
<script language="VB" runat="Server">
function OpenRDR(ByRef sql As String) As SqlDataReader
Dim Conn As SqlConnection = new SqlConnection(ConfigurationSettings.
AppSettings("ConnectionString"))
Dim dbComm As SqlCommand = new SqlCommand(sql,conn)
Dim rs As SqlDataReader
Conn.Open()
rs = dbComm.ExecuteReader(CommandBehavior.CloseConnection)
return rs
end function
</script>
Have I missed something in all my reading? I've only been at .NET for about
a week and a half, but I never saw anything like this in ASP. Any ideas are
welcome.