Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataView/DataSet/DataReader
Message
From
07/01/2007 10:13:13
 
 
To
07/01/2007 02:21:46
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01183234
Message ID:
01183254
Views:
44
Sam,

I pretty much use DataSets for everything. A DataReader is supposedly faster when you need read-forward-only access to your back-end data, but I can't give you much help there, since I've never used a DataReader in real code, only to play with (and a long time ago at that).

As far as your other question, I'm not sure what you mean by: How do you define/create catDS.Tables portion and how does this relate to DataSet or DataReader?

DataTables can be part of a DataSet, or they can stand alone. A DataSet isn't much good without DataTables. In this case, the DataTable named "Categories" is part of your catDS DataSet. How you define a DataTable depends on whether it's a strongly typed DataSet or not. In this case, it's most likely not a Typed DataSet (judging by the syntax), so the DataSet may have been defined in a couple different ways:
DataSet catDS = new DataSet();
DataTable dtCategories = new DataTable("Categories");
dtCategories.Columns.Add("MyColumn", typeof(string));
catDS.Tables.Add(dtCategories);
Or, if you're reading in data from an XML file, it will already have the DataTables defined in it. So, you'd simply do this:
DataSet catDS = new DataSet();
catDS.ReadXml(c:\\MyData.xml");
I won't even get into Typed DataSets at this point, since you've yet to master the whole DataSet concept, but does this help you any?

~~Bonnie



>Hello again
>
>Which is better suited for transfer data from one foxpro DBF to another foxpro DBF, DataSet or DataReader.
>
>I'm trying to decipher
>
>DataView catView = new DataView(catDS.Tables["Categories"]);
>
>
>How do you define/create catDS.Tables portion and how does this relate to DataSet or DataReader?
>
>TIA
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform