SQLClient

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
 
J

John

Hi, I would download and install the 1.1 framework and see if that solves your problem

Regards
John
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
 
G

Guest

John's idea would be the best solution!
U must have System.Data .dll
or try adding the namespace :- System.Data
GDLUCK
Patrick
 
G

Guest

Or what u can do is try adding it manually (If u are using Visual Studio.Net)
by
right clicking on the reference and Add reference on the .Net tab select and
add the Namespace!
GDLUCK
Patrick
 
A

Arpan

Thank you very much, John & Patrick, for your fruitful suggestion. Now I am able to retrieve database records after uninstalling .NET Framework v1.0.2204 & installing .NET Framework v1.1.

Is v1.1 the latest version? One last question please-I have been trying to install .NET SP1.1 (NDP1.1sp1-KB867460-X86.exe) in my system but am unable to do so. Everytime a dialog box pops-up with the following message when I double-click the EXE file:

The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists in your computer and that you have the correct upgrade patch.

With this, the installation terminates. What could the possible problem be & how do I overcome it? Please note that SP1.1 gets downloaded successfully; the problem arises even before the installation starts!

Thank you once again,

Regards,

Arpan


Hi, I would download and install the 1.1 framework and see if that solves your problem

Regards
John
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top