>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