-2
string constring = "datasource=127.0.0.1;port=3306;username=user;password=pass;database=raw_data";
string Query = "SELECT * FROM data WHERE symbol='" + textBox1.Text + "';";
try
{
MySqlConnection connDataBase = new MySqlConnection(constring);
MySqlCommand cmd = new MySqlCommand(Query,connDataBase);
connDataBase.Open();
MySqlDataReader reader = cmd.ExecuteReader();
我試圖改變它很多次,但沒有成功,並尋找沒有找到的soloution。這給我一個錯誤:輸入字符串的格式不正確
該錯誤被引發的是哪一行?什麼是堆棧跟蹤?你熟悉的SQL注入http://stackoverflow.com/questions/601300/what-is-sql-injection? – Kritner
更改查詢使用cmd.Parameters ... – MethodMan