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;
}
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;
}