A
Arpan
I am trying to retrieve records from a SQL Server 7.0 database table for which I am importing the Namespace System.Data.SQLClient using the following Import statement:
<%@ Import Namespace="System.Data.SQLClient" %>
& this is the part of the code that does the retrieving:
<script language="VB" runat="server">
Sub Page_Load(obj As Object,ea As EventArgs)
Dim objDS As DataSet
Dim objConn As SQLConnection
Dim objDapter As SQLDataAdapter
objConn=New SQLConnection("Server=(local);Database=MyDB;UID=sa;PWD=")
objDapter=New SQLDataAdapter("SELECT * FROM Users",objConn)
objDS=New DataSet()
objDapter.Fill(objDS,"Users")
myDataGrid.DataSource=objDS.Tables("Users").DefaultView
myDataGrid.DataBind()
End Sub
</script>
but the above code generates the following error message:
The namespace or type 'SQLClient' for the import 'System.Data.SQLClient' cannot be found.
pointing to the line that imports the namespace. What could the possible problem be? How do I overcome it? Please note that the Assembly "System.Data.dll" does exist in the apt directory i.e. C:\WINNT\Microsoft.NET\Framework\v1.0.2204.
Thanks,
Arpan
<%@ Import Namespace="System.Data.SQLClient" %>
& this is the part of the code that does the retrieving:
<script language="VB" runat="server">
Sub Page_Load(obj As Object,ea As EventArgs)
Dim objDS As DataSet
Dim objConn As SQLConnection
Dim objDapter As SQLDataAdapter
objConn=New SQLConnection("Server=(local);Database=MyDB;UID=sa;PWD=")
objDapter=New SQLDataAdapter("SELECT * FROM Users",objConn)
objDS=New DataSet()
objDapter.Fill(objDS,"Users")
myDataGrid.DataSource=objDS.Tables("Users").DefaultView
myDataGrid.DataBind()
End Sub
</script>
but the above code generates the following error message:
The namespace or type 'SQLClient' for the import 'System.Data.SQLClient' cannot be found.
pointing to the line that imports the namespace. What could the possible problem be? How do I overcome it? Please note that the Assembly "System.Data.dll" does exist in the apt directory i.e. C:\WINNT\Microsoft.NET\Framework\v1.0.2204.
Thanks,
Arpan