i'm using access database
this my code to insert :
this my code to update :Code:sql = "insert into customer([nid_c],[name_customer]" & "values(?,?)" cmd = New OleDbCommand(sql, conn) With cmd.Parameters .Add(New OleDbParameter("@nid_c", CType(cusnid.Text, String))) .Add(New OleDbParameter("@name_customer", CType(cusname.Text, String))) End With
is secure to avoid sql injection ?Code:sql = "update customer set name_customer=? where nid_c = '" & cusnid.Text & "'" cmd = New OleDbCommand(sql, conn) With cmd.Parameters .Add(New OleDbParameter("@nama_customer", CType(cusnama.Text, String))) End With




Reply With Quote
