jump to navigation

MySQL and ASP.NET Revisited January 13 2006

When dealing with parameterized SQL in ASP.NET, usually most (if not all) books will tell you that the magic parameters are preceeded with an “@” symbol (e.g. @myParam) as in :

INSERT INTO myTable VALUES (NULL, @myParam)

However when dealing with MySQL ye may not use the “@” symbol, ye may use the “question mark” such as :

INSERT INTO myTable VALUES (NULL, ?myParam)

===

When actually assigning the parameter values (after the SQL stmt) you would proceed to use the normal “@” symbol

e.g.

param = New MySqlParameter(”@myParam”, MySqlDbType.String, Me.Text.Length, “myColName”)
param.Value = “This is some value”

Enjoy!

Comments

Sorry comments are closed for this entry