Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 2nd, 2003, 02:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default Command & DataSet

Can I set a DataSet by Command object instead of DataAdapter?!?! or both?! if yes How??
Please help

Always:),
Hovik Melkomian.
__________________
Always,
Hovik Melkomian.
 
Old July 2nd, 2003, 12:22 PM
Registered User
 
Join Date: Jul 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can't populate a DataSet with Command object but you can populate DataReader object which is regarded as the fastest way to access the read-only data. Exp:
   SqlDataReader mySqlReader = mySqlCommand.ExecuteReader();

Use DataAdapter to get a DataSet:

   SqlDataAdapter da = new SqlDataAdapter();
   DataSet ds = new DataSet();
   da.SelectCommand = new SqlCommand(sql, connection);
   da.Fill(ds);
 
Old July 3rd, 2003, 01:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

tnx for reply





Similar Threads
Thread Thread Starter Forum Replies Last Post
dataadapter/command/dataset sql timeout rajn ASP.NET 1.0 and 1.1 Professional 0 April 1st, 2008 02:58 PM
prob in Data Environment & Command Rajesh Pachouri Pro VB Databases 0 September 20th, 2006 01:33 AM
The "Right" command & zero filling the data chubnut SQL Server 2000 4 August 18th, 2004 09:29 PM
DataSet & data melvik ADO.NET 6 April 28th, 2004 07:58 AM
SqlCommand & DataSet melvik ADO.NET 4 April 5th, 2004 11:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.