I can not fill data set. I have a procedure with the same name in my database which I call , and it is not an error in spelling. It successfully connect to the database
(Public Sqlcon As New SqlConnection With {.connectionString = "server=xxx-PC\SQLEXPRESS;database=TEST;Trusted_Connection=True;"} )
This is an example of my code.
Public Function getSelc()
Dim objDS = New DataSet
Dim objDA As New SqlDataAdapter
Dim com As New SqlCommand
Sqlcon.Close()
Sqlcon.Open()
Try
com = New SqlCommand("EXECUTE regionSelect '" & txtID.EditValue & " ' , ' " & txtRegion.EditValue & "' , '" & txtShortN.EditValue & "', ' " & txtStatus.EditValue & " ' ", Sqlcon)
objDA.SelectCommand = com
objDA.Fill(objDS) ' => could not find stored procedure.
GridControl1.DataSource = objDS.Tables(0) ' this is my goal
objDA.Dispose()
com.Dispose()
Sqlcon.Close()
MessageBox.Show("The selected data set")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Function