473,508 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLClient

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").Defaul tView
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
Nov 18 '05 #1
4 1846
Hi, I would download and install the 1.1 framework and see if that solves your problem

Regards
John
"Arpan" <ar******@hotmail.com> wrote in message news:Os****************@TK2MSFTNGP11.phx.gbl...
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").Defaul tView
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
Nov 18 '05 #2
John's idea would be the best solution!
U must have System.Data .dll
or try adding the namespace :- System.Data
GDLUCK
Patrick

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

Regards
John
"Arpan" <ar******@hotmail.com> wrote in message news:Os****************@TK2MSFTNGP11.phx.gbl...
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").Defaul tView
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

Nov 18 '05 #3
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
"Arpan" wrote:
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").Defaul tView
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

Nov 18 '05 #4
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
"John" <do**@spam.me> wrote in message news:uB****************@TK2MSFTNGP11.phx.gbl...
Hi, I would download and install the 1.1 framework and see if that solves your problem

Regards
John
"Arpan" <ar******@hotmail.com> wrote in message news:Os****************@TK2MSFTNGP11.phx.gbl...
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").Defaul tView
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
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1412
by: Tony Zoccolillo | last post by:
I have a SQL Server database on a Windows 2000 Server. I have IIS running on a 2nd 2000 Server with no SQL Server on it.. Neither are the PDC. Both servers have the most recent .NET framework...
2
4560
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
2
8884
by: James Cooke | last post by:
Hi all, I want to catch a duplicate key exception. I do not want to provide that verbose message from the MSSQL server - I would put a user friendly message out, like "The item you have added...
0
2035
by: john | last post by:
I know that windows CE has a SQLCE client namespace but i do not want to use it because it needs to download my sql tables to a local sql database on the CE.NET client machine. I would rather have...
1
5164
by: John Bailo | last post by:
I'm doing a profile on my SQL Server to see if I can eliminate any long running statements, and periodically, I see an entry for ".NET SqlClient Data Provider". The durations for it are very...
3
15332
by: Rampa | last post by:
hello! the problem is always the same but i can't understand why it happens!! Someone can help me? FIRST QUERY GOES WELL, SECOND BREAK WITH ERROR why? Dim connessione As New...
5
2495
by: mmatchyn | last post by:
I have been trying to create a class similar to SqlClient but one that prints sql statements instead of running them on the database. This way when I want to go into test mode I comment out the...
2
1873
by: =?Utf-8?B?Y2hpZWtv?= | last post by:
Hello, We recently converted from ASP.net 1.X to ASP.net 2.0 application. Since then, we randomly get the SQL errors when the function tries to get records from SQL. We are using stored...
3
24222
by: weird0 | last post by:
This is the exception that I get when i create a webserivce obj and call. The error comes on the webmethod call, when it opens a connection to the db. How do I fix it? What is the solution to...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.