473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Connectivity between SQL and ASP.NET

Inorder to fetch data from SQL database...i have written the following scripts...but it is showing errors which i am unable to debug..pls help me with this..

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
<%@ Import Namespace="System.Data.OleDb"%>

<script runat="server">

sub Page_Load
Dim dbconn, sql, dbcomm, dbread, datasource
dbconn = New sqlDbConnection("Provider=Microsoft.Jet.OLEDB.4.0" )
datasource=" & server.mappath("conn\userdetails.mdb"))
dbconn.Open()
sql = "SELECT * FROM userdetails"
dbcomm = New OleDbCommand(Sql, dbconn)
dbread = dbcomm.ExecuteReader()
End Sub
</script>
End Class
Aug 8 '06 #1
4 1580
Enyi
38
What error do you get?
Aug 9 '06 #2
Well, I think if u use sqldata provider then in the connection your provider should be sql connection, not OLEDB.
Aug 9 '06 #3
Enyi
38
Well, I think if u use sqldata provider then in the connection your provider should be sql connection, not OLEDB.
Well spotted, I never noticed. You know ... it could be the other way round :)
Aug 9 '06 #4
bhar
37
Hi,

Note:

When we use a SqlConnectio, you don't have to specify a provider, because the class talks directly to the SQL Server API.

Regards
bhar
[Link Removed]
Aug 14 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the...
2
by: Axel Dachtler | last post by:
I am looking for detailed information about the topic "connectivity" in Oracle 9i including JDBC and CGI. Thank you
1
by: harish | last post by:
I am using java applications to connect to my MS SQL Server database. I am using ODBC for database connectivity. If i am running my java applications in a remote PC and try to connect to database...
1
by: Darren McDowell via .NET 247 | last post by:
I have a situation, I was wondering if someone could help me. Wehave a .net web service, it runs several transactions in sqlserver 2000. We have several clients which connect to this webservice in...
3
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.