By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,165 Members | 1,429 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,165 IT Pros & Developers. It's quick & easy.

a simple SqlDataAdapter problem

P: n/a
HS1
Hello.

I declare a SqlDataAdapter in a FormLoad as below. However, there is error
claimed that the SqlDataAdapter is not defined.

Could you please tell me what to do

------------------

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim da1 As SqlDataAdapter


Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The error message is referring to the fact that you don't have the
System.Data.SqlClient namespace imported at the top of your code file.

Right above the public class line, add this;

Imports System.Data.SqlClient

--
Gerry O'Brien MCT, MCDBA, MCSD
Visual Developer .NET MVP
"HS1" <so*@slingshot.co.nz> wrote in message
news:1096845689.550343@ftpsrv1...
Hello.

I declare a SqlDataAdapter in a FormLoad as below. However, there is error
claimed that the SqlDataAdapter is not defined.

Could you please tell me what to do

------------------

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim da1 As SqlDataAdapter

Nov 21 '05 #2

P: n/a
HS1, you havne't qualified your reference -
System.Data.SqlClient.SqlDataAdapter (or do it the easy way and use
Imports). Remember though, that before you try referencing it, you need the
New Keyword- that's one of the problems you're encountering in the post
above with your SqlConnection.

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"HS1" <so*@slingshot.co.nz> wrote in message
news:1096845689.550343@ftpsrv1...
Hello.

I declare a SqlDataAdapter in a FormLoad as below. However, there is error
claimed that the SqlDataAdapter is not defined.

Could you please tell me what to do

------------------

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim da1 As SqlDataAdapter

Nov 21 '05 #3

P: n/a
Bill,
HS1, you havne't qualified your reference -
It is VBNet, you know not C#, VBNet gives a nice blue line when you do that.
You have so much written of how good that VBNet IDE is.
Remember though, that before you try referencing it, you need the
New Keyword- that's one of the problems you're encountering in the post
above with your SqlConnection.


Therefore this is probably the answer

:-)

Cor
Nov 21 '05 #4

P: n/a
Doh,

Completly wrong, should be just in the other way.
HS1, you havne't qualified your reference -


It is VBNet, you know not C#, VBNet gives a nice blue line when you do
that. You have so much written of how good that VBNet IDE is.


And that says what HS told
Remember though, that before you try referencing it, you need the
New Keyword- that's one of the problems you're encountering in the post
above with your SqlConnection.

And therefore he never reaches this

Nock nock on my head.

:-)

Cor

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.