A
aXiS_PoWeR
Guest
can anyone tell me an SQL command for adding or deleting a field from SQL Server 2000 using a objCmd.ExecuteNonQuery() ?
objCmd.CommandText = "DELETE * FROM myTable WHERE ID > 0"
objCmd.ExecuteNonQuery()
Originally posted by Derek Stone
Code:objCmd.CommandText = "DELETE * FROM myTable WHERE ID > 0" objCmd.ExecuteNonQuery()
command.CommandText = "DELETE * FROM table WHERE item_id LIKE "+noBox.Text;
command.ExecuteNonQuery();
Originally posted by wyrd
Change
"DELETE * FROM table WHERE item_id LIKE "+noBox.Text
to
"DELETE * FROM table WHERE item_id LIKE " + noBox.Text + ""
You have to put strings inside . If the item_id is supposed to be a number then youll need to cast noBox.Text to an Integer.
Originally posted by wyrd
Hmm.. well what exactly is in noBox.Text? Just numbers like 1, 2, 3, etc.. or something like ID1, ID2, ID3, etc..?
sSQL = "DELETE * FROM journal_detail WHERE item_id LIKE %" & noBox.Text & "%"
Originally posted by Derek Stone
Give it one more shot.Code:sSQL = "DELETE * FROM journal_detail WHERE item_id LIKE %" & noBox.Text & "%"