I'm creating an app that has a text box where users can input a command to be run against a SQL Server instance. I've imported the System.Data.SqlClient object, and here's the code I have so far:
Dim preSQLcmd As String = Me.txtPreSQL.Text
Databasefn.preTestSQL(preSQLcmd)
Databasefn.preTestSQL looks like this:
Sub preTestSQL(cmd As SqlCommand)
con = New SqlConnection("Data Source=" & utilnamespace.sqlSvr & ";Database=" & utilnamespace.testDbName & ";integrated security=SSPI;")
cmd.Connection.Open()
cmd.ExecuteNonQuery()
cmd.Connection.Close()
End Sub
What am I missing here?
Delete From tableNameoh, no more data!