字串組法
Dim id As String = "8"
Dim desc As String = "aaabb"
- cmd.CommandText ="insert into region values(" & id & ",'" & desc & "')"
- cmd.CommandText =String.Format( "insert into region values({0},'{1}')", id, desc)
- Parameters
cmd.Parameters.AddWithValue("@id", id)
cmd.Parameters.AddWithValue("@desc", desc)
0 個意見:
張貼留言
訂閱 張貼留言 [Atom]
<< 首頁