Convert Dictionary to MySqlParameter Array

  • Thread starter Thread starter Mike_1369
  • Start date Start date
M

Mike_1369

Guest
Hello,

I did the following and it worked:

MySqlParameter[] myParams = new[]
{
new MySqlParameter("@LoginID", "Login ID"),
new MySqlParameter("@RealName", "Real Name"),
new MySqlParameter("@Password", "password"),
new MySqlParameter("@Role", "admin")
};


I created a Dictionary object <string, string> that contains the Param Value (@LoginID, etc), and the value is the value from the fields on the form.

Can I convert the dictionary key/pair values to an Array of MySqlParamater like in the above example, or would there be a different / better way to just pass the dictionary to the query params ?

Continue reading...
 
Back
Top