Mywk

Mywk

  • NA
  • 1
  • 0

Index and length must refer to a location within the string?!

Aug 8 2009 11:58 PM
Hi All,

I'm having the error:
Index and length must refer to a location within the string
Parameter name: length

At the following code:
 
MySqlCommand command4 = Form2.connection.CreateCommand();
command4.CommandText = "update products_to_categories set products_name='" + textBox1.Text + "', products_description='" + textBox8.Text.Replace("\r\n", "<br>") + "' WHERE products_id=" + id + " AND language_id=4";
command4.ExecuteNonQuery();

There is nothing wrong with the code and others sql statements work well so why does it throw that error?

Thanks, Regards,
Mywk

Answers (2)