mandelbrot Posted July 12, 2005 Posted July 12, 2005 (edited) Hi Everyone, Just a quick question here - Is there any real advantage in using the SqlCommand object (or any Command object, for that matter)? TIA, Paul. Edited July 12, 2005 by mandelbrot Quote
Joe Mamma Posted July 13, 2005 Posted July 13, 2005 Hi Everyone, Just a quick question here - Is there any real advantage in using the SqlCommand object (or any Command object, for that matter)? TIA, Paul.Well if you want to get data out of a database using managed code, its the only way I know of. . . Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Machaira Posted July 13, 2005 Posted July 13, 2005 Not really, you can just use the Connection, DataAdapter, and Dataset objects. Quote Here's what I'm up to.
Administrators PlausiblyDamp Posted July 13, 2005 Administrators Posted July 13, 2005 Not without a command object you can't - a DataAdapter can take care of the creation of the command for you but there is still a command object being created. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Machaira Posted July 14, 2005 Posted July 14, 2005 Granted, but you're not dealing with it yourself, which is what I understood the Joes's point to be. Quote Here's what I'm up to.
mandelbrot Posted July 21, 2005 Author Posted July 21, 2005 (edited) ...and expanding on this... Sorry, guys - I didn't receive an e-mail for this thread *(I've set the option in my control panel, now - missed it before!)*, and haven't managed to get back for quite a while. Yep - I was actually using a DataSet object and noticed that you can enter the SQL command directly as a string. I didn't realise that doing this actually makes the DataSet generate an SQL Command object. Just to extend this question further, then: Is there any advantage, also, to using parameters? After all, the query string could be built up using appended strings then submitted as a Command directly, instead of having to use parameter objects... (Please note that these are more questions, I suppose, of "what is good and bad practice within OOP and VS.NET?"). Thanks again, to you all. Paul. Edited July 21, 2005 by mandelbrot Quote
Administrators PlausiblyDamp Posted July 21, 2005 Administrators Posted July 21, 2005 http://www.xtremedotnettalk.com/showthread.php?t=90608 http://www.xtremedotnettalk.com/showthread.php?t=87082 http://www.xtremedotnettalk.com/showthread.php?t=86066 http://www.xtremedotnettalk.com/showthread.php?t=84159 all cover the issue of parameters in some way. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
mandelbrot Posted July 21, 2005 Author Posted July 21, 2005 Excellent - thanks for that! You've answered all the questions I had there. :) Paul. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.