Click here to Skip to main content
15,903,033 members
Home / Discussions / Database
   

Database

 
GeneralMy problem... Pin
KORCARI7-Jan-05 13:30
KORCARI7-Jan-05 13:30 
GeneralRe: My problem... Pin
Colin Angus Mackay8-Jan-05 6:59
Colin Angus Mackay8-Jan-05 6:59 
GeneralSQL Statement Problem Pin
Anonymous7-Jan-05 5:24
Anonymous7-Jan-05 5:24 
GeneralRe: SQL Statement Problem Pin
Mike Ellison7-Jan-05 5:33
Mike Ellison7-Jan-05 5:33 
GeneralRe: SQL Statement Problem Pin
Anonymous7-Jan-05 8:22
Anonymous7-Jan-05 8:22 
GeneralRe: SQL Statement Problem Pin
Mike Ellison7-Jan-05 9:14
Mike Ellison7-Jan-05 9:14 
GeneralRe: SQL Statement Problem Pin
Anonymous7-Jan-05 10:23
Anonymous7-Jan-05 10:23 
GeneralRe: SQL Statement Problem Pin
Colin Angus Mackay7-Jan-05 10:39
Colin Angus Mackay7-Jan-05 10:39 
You need to tell your command object about your connection, otherwise it doesn't know where (i.e. which SQL Server and database) to run your command. The documentation for the SqlCommand[^] object states that there is another constructor that takes the SqlConnection object as well as the command text.

So, this line:
'--create the SqlCommand object (a connection would need to be set up too)
Dim cmd As SqlCommand = New SqlCommand(StrSQLQuery)
should be changed to
'--create the SqlCommand object (a connection would need to be set up too)
Dim cmd As SqlCommand = New SqlCommand(StrSQLQuery, objConnection)
Also, you have a line that reads Dim objDataReader As SqlDataReader but since you are using a data adapter to get the data out of the database you do not need this and you may remove it.

I hope this helps.


Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums


GeneralRe: SQL Statement Problem Pin
Anonymous7-Jan-05 11:07
Anonymous7-Jan-05 11:07 
GeneralRe: SQL Statement Problem Pin
Colin Angus Mackay7-Jan-05 11:13
Colin Angus Mackay7-Jan-05 11:13 
GeneralRe: SQL Statement Problem Pin
Colin Angus Mackay7-Jan-05 10:42
Colin Angus Mackay7-Jan-05 10:42 
GeneralRe: SQL Statement Problem Pin
David Salter7-Jan-05 5:36
David Salter7-Jan-05 5:36 
GeneralRe: SQL Statement Problem Pin
Anonymous7-Jan-05 6:46
Anonymous7-Jan-05 6:46 
GeneralRe: SQL Statement Problem Pin
tecnovate_vivek8-Jan-05 1:37
tecnovate_vivek8-Jan-05 1:37 
Generalinsert record into mysql table Pin
kd83417-Jan-05 3:25
kd83417-Jan-05 3:25 
GeneralRe: insert record into mysql table Pin
David Salter7-Jan-05 5:42
David Salter7-Jan-05 5:42 
QuestionOnly last 50 rows??? Pin
Anonymous7-Jan-05 2:43
Anonymous7-Jan-05 2:43 
AnswerRe: Only last 50 rows??? Pin
Ritesh12347-Jan-05 3:09
Ritesh12347-Jan-05 3:09 
GeneralRe: putting strings into sqlcommand Pin
Colin Angus Mackay6-Jan-05 22:26
Colin Angus Mackay6-Jan-05 22:26 
GeneralExcel text field not taking big CString using VC++ Pin
Anshul Mehra6-Jan-05 20:20
professionalAnshul Mehra6-Jan-05 20:20 
Generalputting strings into sqlcommand Pin
sianatia6-Jan-05 18:34
sianatia6-Jan-05 18:34 
GeneralAngry DBA Pin
Anonymous6-Jan-05 14:24
Anonymous6-Jan-05 14:24 
GeneralODP.NET : How to access function with VARCHAR2 as ReturnValue Pin
arnab19745-Jan-05 16:49
arnab19745-Jan-05 16:49 
QuestionHow to use insert command in Access database? Pin
DuyNguyen5-Jan-05 7:43
DuyNguyen5-Jan-05 7:43 
AnswerRe: How to use insert command in Access database? Pin
Mike Ellison7-Jan-05 5:55
Mike Ellison7-Jan-05 5:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.