Add parameterized queries in MySql (OleDb) – Programming, Pseudocode Example, C# Programming Example

Add parameterized queries in MySql (OleDb)

To connect to MySQL database you can use the System.Data.Odbc namespace in .net

Adding parameters the queries in System.Data.Odbc works different than System.Data.SqlClient. While using a SqlCommand we add parameters in form of @parameter name. Parameter names are directly mapped to their values.

But this is not the case for an OdbcCommand. The parameters in an OdbcCommand are specified by “?” and the sequence of adding parameters is really important unlike to SqlCommand.




Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: