|
-
Mar 24th, 2004, 07:06 AM
#1
Thread Starter
Lively Member
SQLConnection Problem
Hello
I have written following code for getting connectivity with SQL Server. DB server is on separate pc. I am giving its IP address in connection string.
Dim myConnectionString As String = "Provider=SQLOLEDB; Data Source=IP Addr of db server; Initial Catalog=DB Name; User Id=UserName; Password=Password;"
Dim myConnection As New SqlConnection(myConnectionString)
myConnection.Open()
Dim myReadQuery As String = "select * from dbAkitaAdmin"
Dim myCommand As New SqlCommand(myReadQuery)
Dim adapter As New SqlDataAdapter()
Dim myDataSet as New DataSet()
adapter.SelectCommand = myCommand
adapter.Fill(myDataSet)
But it is giving me error as follows
Compiler Error Message: BC30002: Type 'SqlConnection' is not defined.
Pls suggest the way for this connectivity.
Also pls kindly expln about usage of SqlCommand, SqlDataAdapter and SqlDataReader classes.
Thanks
Mahesh
Everybody is always learning something new ! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|