I am suppose to run a stored procedure.. and I will get a null or true output from the SP.
but I am lost on how to do this..
here is my code:
How am I suppose to compare the output to either true or null?
thanks
Lee
but I am lost on how to do this..
here is my code:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyConnection As New OleDbConnection("Provider=SQLOLEDB.1;User Id=" & TextBox1.Text & ";Password=" & TextBox2.Text & ";Initial Catalog=WeGIR Member Data;Data Source=secure.server.com;Use Encryption for Data=True")
Dim ds As DataSet
Dim da As OleDbDataAdapter
Dim myCmd As New OleDb.OleDbCommand("sp_ValidateLogin")
Dim myReader As OleDb.OleDbDataReader
myCmd.Connection = MyConnection
myCmd.CommandType = CommandType.StoredProcedure
Try
MyConnection.Open()
TextBox3.Text = "database open"
Dim ValidateLogin As String = "EXECUTE sp_ValidateLogin"
Dim Results As New OleDbDataAdapter(ValidateLogin, MyConnection)
ds = New DataSet
da.Fill(ds, "Results")
myReader = myCmd.ExecuteReader()
Do While myReader.Read
TextBox4.Text = myReader.Read
Loop
myReader.Close()
MyConnection.Close()
TextBox3.Text = TextBox3.Text & vbNewLine & "database closed"
Catch myerror As MySqlException
TextBox3.Text = "error"
Finally
If MyConnection.State <> ConnectionState.Closed Then MyConnection.Close()
End Try
End Sub
How am I suppose to compare the output to either true or null?
thanks
Lee