我有表,我想設置值,如果cell = null,然後通過文本框設置記錄。 這裏是我的表如何通過更新查詢設置記錄sql vb.net
--------------------
col1| col2| Note
1 2 aaa
5 5 (*) set record Only here if cell is Null
42 14
47 55
------------------
這裏是我的代碼,我的問題是每一個細胞是空查詢寫我想寫只爲下一個單元格,以前不爲空
con.Open()
query = " update firealarm set [email protected] where Note Is Null"
Dim command As SqlCommand = New SqlCommand(query, con)
command.Parameters.Add(New SqlParameter("@Note", SqlDbType.NVarChar))
command.Parameters("@Note").Value = Notebox.Text.ToString
command.ExecuteNonQuery()
con.Close()
你很容易sql注入 – Sherlock
'query =「更新firealarm設置注= @注意哪裏注意是空的」 – Subrati