using the SqlParameterCollection
Hi,
I got this:
[----- To overcome this, you need to iterate through the source array and add each value to the SqlParameterCollection collection----]
string[] source = Convert.ToString(cboToCountry.EditValue).Split(new char[] { cboToCountry.Properties.SeparatorChar });
StringBuilder sb = new StringBuilder();
foreach (string s in source)
sql_command.Parameters.AddWithValue("param_country", s.Trim());
not sure how can I use the MySqlParameterCollection and MySQL Connectors.
here is my code:
sql_connection = new MySqlConnection(serverClass.connectionstring("BlueFile", "BlueFile", "Server"));
sql_connection.Open();
sql_command = new MySqlCommand("sp_populate_memo_country_companies", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
// sql_command.Parameters.AddWithValue("param_country", country_codes(Convert.ToString(cboToCountry.EditValue))).MySqlDbType = MySqlDbType.VarChar;
string[] source = Convert.ToString(cboToCountry.EditValue).Split(new char[] { cboToCountry.Properties.SeparatorChar });
StringBuilder sb = new StringBuilder();
foreach (string s in source)
{
sql_command.Parameters.AddWithValue("param_country", s.Trim()).MySqlDbType = MySqlDbType.VarChar;
}
Subject
Written By
Posted
using the SqlParameterCollection
August 10, 2016 03:33PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.