Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I return SqlDataReader in Module
Message
From
26/05/2011 12:13:22
 
 
To
22/05/2011 09:08:27
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01511205
Message ID:
01511869
Views:
41
>yes ar, so i don't understand where is the problem .....
>conn.Open() , no problem then is connected la
>And syslib table has data.....


There's absolutely nothing wrong with this statement:
Dim sqlcmd As New SqlCommand("select * from syslib", conn)
I can't imagine why sqlcmd would be null. Even if your SqlConnection (conn) wasn't totally set up, the New SqlCommand() method would still return a non-null SqlCommand. Are you absolutely sure that's the error you have (that sqlcmd is null)?

Also, if you have a Try, you should also have a Catch, otherwise what's the point ...

Since the orignal code you posted had that extra EndIf in there, I suspect that you did not actually copy/paste the code you're actually trying to trouble-shoot. Did you leave out something that might help us figure this out? How about posting the code again, this time what you're actually stuck on.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform