I am trying to save a float value that is changing in my C# code using windows form and sql but I have the error above.
Any ideas how to fix it?
Thank you in advance!!
my code:
string sqlQuery = "INSERT INTO floatdatareading(DateTime,tank1_volume) VALUES(" + "'" + tank1VolumeDateTime.ToString("yyyy- MM- dd HH: mm:ss") + "'" + "," + "'" + textBox5.Text.ToString() + "'" + ")";
SqlConnection con = new SqlConnection(connectionString);
con.Open();
SqlCommand sc = new SqlCommand(sqlQuery, con);
sc.ExecuteNonQuery();
con.Close();
As you can see I want to save the content of textbox5 (float number) in sql database. The datetime is working but my float data not.
Note:my table in sql has declared the column of my data as float.