By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

DeleteCommand

P: n/a
Hello,

How can I use the DeleteCommand to delete a record where the delete statment
takes a CustomerID as a parameter (CustomerID is the variable that holds
Customer ID taken from a TextBox)

Thanks
--
Regads,
Rochdi
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"John" <Jo**@discussions.microsoft.com> schrieb:
How can I use the DeleteCommand to delete a record where the delete
statment
takes a CustomerID as a parameter (CustomerID is the variable that holds
Customer ID taken from a TextBox)


Sample (look for "DELETE FROM"):

..NET Framework Class Library -- 'SqlDataAdapter' Constructor ('SqlCommand')
<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlDataAdapterClassctorTop ic2.asp>

Note that this sample shows how to use a parameterized command. This
approach is recommended over building up the whole command string by hand
because it protects from SQL injection.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.