a simple SqlDataAdapter problem

  • Thread starter Thread starter HS1
  • Start date Start date
H

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
 
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
 
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.
 
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
 
Doh,

Completly wrong, should be just in the other way.
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
And therefore he never reaches this

Nock nock on my head.

:-)

Cor
 

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

Back
Top