Execute Parameterized SQL StoredProcedure via ODBC

前端 未结 5 1074
一向
一向 2020-12-10 07:09

From within a C# WinForms app I must execute a parameterized Stored Procedure on a MS SQL Express Server. The Database Connection works, the Procedure works either, but I ge

5条回答
  •  天涯浪人
    2020-12-10 07:36

    Well - I now managed to solve the problem on my own, with some help from the MSDN-documentation.

    The correct statement to execute a stored procedure via ODBC is as follows:

    OdbcCommand ODBCCommand = new OdbcCommand("{call getDetailsFromEmail (?)}", ODBCConnection);
    ODBCCommand.CommandType = CommandType.StoredProcedure;
    ODBCCommand.Parameters.AddWithValue("@KundenEmail", KundenEmail);
    

    Nevertheless - thanks for your help Thorsten.

提交回复
热议问题