I have written a sample to insert txt file to MySql DB but i am getting an error as unknown column _Fname
My code:
string strQuery = "insert into tblFiles(FName,FData) values (_FName, _FData)";
MySqlCommand cmd = new MySqlCommand(strQuery);
cmd.Parameters.AddWithValue("_FName", filename);
cmd.Parameters.AddWithValue("_FData", bytes);
Even this to the same error:
cmd.Parameters.Add("_FName", MySqlDbType.VarChar).Value = filename;
cmd.Parameters.Add("_FData", MySqlDbType.LongText).Value = bytes;
Sounds like the _FName is not being interpretted as a token/parameter by the command.
Try using @_FName instead …