SweetingA
asked on
Check is SQL table exists via vb
There are lots of blogs on this but all seem a little complicated.
I have tried this but i am not sure what to then check, should cmd be a boolean? I guess not as its the result of a command line.
cmd = New SqlCommand("SELECT OBJECT_ID('temptbl_Stops') ", con)
If con.State = ConnectionState.Closed Then con.Open()
cmd.ExecuteNonQuery()
If cmd = False Then
Else xxx
Thanks in advance
I have tried this but i am not sure what to then check, should cmd be a boolean? I guess not as its the result of a command line.
cmd = New SqlCommand("SELECT OBJECT_ID('temptbl_Stops')
If con.State = ConnectionState.Closed Then con.Open()
cmd.ExecuteNonQuery()
If cmd = False Then
Else xxx
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nothing is ever perfect (time is missing to give more complete information), but I try ;-)
I suggest that you give a look at the documentation and examine the different Execute... methods that are available for the SqlCommand object. You need to have a good idea of what each does in order to be comfortable working with ADO.NET.
I suggest that you give a look at the documentation and examine the different Execute... methods that are available for the SqlCommand object. You need to have a good idea of what each does in order to be comfortable working with ADO.NET.
ASKER