[VB.NET] acces a une procedure stockee
Bonjour
Sur la ligne myCommand.executeNonQuery j'ai une exception:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
SelectedTable et SelectedView contiennent des chaines correctes et ma procedure marche dans sqlserver.
Qu'est ce qui ne va pas dans mon code ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| Dim con As New SqlConnection(connString)
Dim myCommand As SqlCommand
Dim parmResult As SqlParameter
myCommand = New SqlCommand("pr_equivalents", con)
myCommand.CommandType = CommandType.StoredProcedure
myCommand.Parameters.Add("@myTable", SelectedTable)
myCommand.Parameters.Add("@myObject", SelectedView)
parmResult = myCommand.Parameters.Add("@result", SqlDbType.Int)
parmResult.Direction = ParameterDirection.Output
con.Open()
myCommand.ExecuteNonQuery() |
Merci