|
-
Jun 14th, 2004, 08:15 PM
#1
Thread Starter
Lively Member
Connecting Sql to Vb.net
If anyone could help me with this I would be very greatfull. I am new to vb.net and I am trying to get a combo box to read a field from my sql table. I am using my local server on my computer so I don't have a user name or password. All of the code that I have tried to use gives me a blue line underneath some of my statements saying it has not been declared. If someone could help me out I would be most greatfull!!!!!!!!!!!
-
Jun 14th, 2004, 08:23 PM
#2
Lively Member
imports system.data.sqlclient ???
-
Jun 14th, 2004, 08:53 PM
#3
Frenzied Member
Since you didn't post any code, it's pretty tough to say where it might be wrong.
-
Jun 14th, 2004, 08:58 PM
#4
Thread Starter
Lively Member
This is what i used.
Dim myconnection as sqlconnection
Dim mycommand as sqlcommand
Dim myDatagrid as datagrid
I get blue lines underneath "myconnection, mycommand, and mydatagrid" saying that thier not declaired.
-
Jun 14th, 2004, 08:58 PM
#5
Lively Member
Dim myconnection as new sqlconnection
also with everyone else.
-
Jun 14th, 2004, 09:03 PM
#6
Thread Starter
Lively Member
When I use the Dim myconnection as new sqlconnection the blue line is under sqlconnection saying that its not defined?
-
Jun 14th, 2004, 09:05 PM
#7
Lively Member
imports system.data.sqlclient
-
Jun 14th, 2004, 09:07 PM
#8
Thread Starter
Lively Member
yeah but the imports has a blue line under it saying it must precede any declarations.
-
Jun 14th, 2004, 09:07 PM
#9
Lively Member
put it topmost
imports blah
public class
.
.
.
end class
-
Jun 14th, 2004, 09:10 PM
#10
Thread Starter
Lively Member
-
Jun 14th, 2004, 09:21 PM
#11
Thread Starter
Lively Member
I don't have a user name and password for my local sql, do I just leave that out of the code?
-
Jun 14th, 2004, 09:28 PM
#12
Lively Member
i don't know much about this thing but i think this connectionstring should take care of this
Code:
dim cn as new sqlconnection()
cn.connectionstring="integrated security=true;initial catalog=northwind")
that is, if your database to access is northwind...
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
|