Hi
I am trying to display some data in a table but am getting the following error, but cannot see what to change to rectify this;
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30519: Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:
Source Error:
Line 41: conn.Open()
Line 42:
Line 43: Dim da As New Odbc.OdbcDataAdapter(sql, conn)
Line 44: da.Fill(ds, "OutOfSpec")
Line 45: Return ds
My code for this is:
Any ideas what I have done wrong?
Help greatly appreciated!
Thanks in advance
I am trying to display some data in a table but am getting the following error, but cannot see what to change to rectify this;
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30519: Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:
Source Error:
Line 41: conn.Open()
Line 42:
Line 43: Dim da As New Odbc.OdbcDataAdapter(sql, conn)
Line 44: da.Fill(ds, "OutOfSpec")
Line 45: Return ds
My code for this is:
VB.NET:
Function TotalOutOfSpec() As DataSet
Dim conn = New Odbc.OdbcConnection
Dim sql As String
Dim ds As New DataSet
Dim dtResults As New DataTable("OutOfSpec")
sql = "SELECT SubjectID, TestID FROM TestResults WHERE OutofSpec = 'True'"
' connectionstring using session variable ConnString to connect to user's database
conn.ConnectionString = Session.Item("ConnString")
Conn.Open
Dim da As New Odbc.OdbcDataAdapter(sql, conn)
da.Fill(ds, "OutofSpec")
Return ds
End Function
Any ideas what I have done wrong?
Help greatly appreciated!
Thanks in advance