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
Don't use ODBCConnection
to connect to a SQL Server. Use the "normal" SqlConnection
, SqlCommand
, etc. These are the ones made to work with SQL Server.
EDIT: Also, you should use the SqlConnectionStringBuilder
to assembly the connection string. This is far less error prone than putting the entire connection string into a configuration file or creating it by hand.