C#update語句我收到錯誤消息:與提取
IErrorInfo.GetDescription失敗,E_FAIL(0x80004005的)
我覺得在代碼是不是需要[]
或任何變量?
我在尋找,每個人都與[]
有關。
string queryString = "SELECT sum(skupaj) FROM cas where sifra = " + textBox1.Text + " and EXTRACT(MONTH FROM Datum) = "+textBox2.Text+"";
try
{
OleDbConnection conn = GetConnection();
OleDbCommand command = new OleDbCommand(queryString, conn);
conn.Open();
OleDbDataReader reader = command.ExecuteReader();
while (reader.Read())
{
ure = reader.GetValue(0).ToString(); ;
}
reader.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
我想讀SQL注入。例如,如果某人在TextBox2中輸入了「DROP TABLE cas」,那麼您的代碼可能會受到攻擊。 –
我知道,但那不是重點,我需要那個查詢工作。 – CrashDown