473,387 Members | 1,812 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,387 software developers and data experts.

a simple SqlDataAdapter problem

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
4 5275
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bruce W...1 | last post by:
In my effort to learn PHP I'm playing with some simple email scripts. They worked a few days ago but they stopped working. The only thing I've done to this Windows 2000 PC in this time was a...
6
by: chonkme | last post by:
Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name....
2
by: not | last post by:
Hello All, I am trying to develop a relatively simple self-quiz form in javascript, but I'm having no luck getting it to work. What I am looking for is a script that allow the user to select...
3
by: Jim | last post by:
Hello, I have a simple problem which I am guessing has an easy answer within JavaScript. I have a form1 with two fields, field1 and field2. I want the contents of field1 to be transferred to...
1
by: Steven Blair | last post by:
Hi, Here is a short decsription of my problem. I have written a dll for Database accessing. I have one method which can return a Dataset and another method which takes a Dataset and upates a...
4
by: bmgz | last post by:
I have a simple DHTML gallery: <script> viewPhoto(thumb){ function viewPhoto(thumb){ document.getElementById('mainPhoto').src=thumb.href; return false; } </script>
11
by: nicholas_ian_reese | last post by:
Hi all, I am tutoring introductory computer science in the Solomon Islands and we are using C++ as the language of choice (nice). Please note that I am no way a C++ programmer, but have but I...
2
by: kj | last post by:
I'm sure this is a simple, but recurrent, problem for which I can't hit on a totally satisfactory solution. As an example, suppose that I want write a module X that performs some database...
3
by: zapras | last post by:
I need some help pretty please? :confused: Im very new to vba access and been trying to work out this problem for a couple of hours. It's probably simple for other people to see the problem though....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.