473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

DataSet on the fly

JPS
Does anyone know how to create a dataset on the fly with specific names
fields?

Jan 16 '07 #1
4 1779
DataSet ds = new DataSet("dsName");
ds.Tables.Add("dtTable");
ds.Tables["dtTable"].Columns.Add("ZipCodes");

http://www.codershangout.com
JPS wrote:
Does anyone know how to create a dataset on the fly with specific names
fields?
Jan 16 '07 #2
JPS
Thanks. Do you know how to add values to this as well?

On Jan 16, 9:01 am, "cbmeeks" <cbme...@gmail.comwrote:
DataSet ds = new DataSet("dsName");
ds.Tables.Add("dtTable");
ds.Tables["dtTable"].Columns.Add("ZipCodes");

http://www.codershangout.com

JPS wrote:
Does anyone know how to create a dataset on the fly with specific names
fields?- Hide quoted text -- Show quoted text -
Jan 16 '07 #3
Hi,

You mean like

DataRow row = ds.Tables[0].NewRow();
row["ZipCodes"] = "12345";

--
Ignacio Machin
machin AT laceupsolutions com
"JPS" <jp*****@yahoo.comwrote in message
news:11**********************@l53g2000cwa.googlegr oups.com...
| Thanks. Do you know how to add values to this as well?
|
| On Jan 16, 9:01 am, "cbmeeks" <cbme...@gmail.comwrote:
| DataSet ds = new DataSet("dsName");
| ds.Tables.Add("dtTable");
| ds.Tables["dtTable"].Columns.Add("ZipCodes");
| >
| http://www.codershangout.com
| >
| >
| >
| JPS wrote:
| Does anyone know how to create a dataset on the fly with specific
names
| fields?- Hide quoted text -- Show quoted text -
|
Jan 16 '07 #4
Ignacio Machin beat me to it.

http://www.codershangout.com

JPS wrote:
Thanks. Do you know how to add values to this as well?

On Jan 16, 9:01 am, "cbmeeks" <cbme...@gmail.comwrote:
DataSet ds = new DataSet("dsName");
ds.Tables.Add("dtTable");
ds.Tables["dtTable"].Columns.Add("ZipCodes");

http://www.codershangout.com

JPS wrote:
Does anyone know how to create a dataset on the fly with specific names
fields?- Hide quoted text -- Show quoted text -
Jan 16 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
3
by: Jeronimo Bertran | last post by:
Hi, I have an xml file that encapsulates a dataset definition within a set of tags (<dataset>)... here is an example <?xml version="1.0" encoding="utf-16"?> <dataset> <MyTable>...
2
by: JS | last post by:
I'm trying to create a data layer and having problems returning a DataSet from my code that's in a class module. Please forgive me. I'm new to C# (VB'er). I decided to create my data layer in...
5
by: Mike | last post by:
I need to expand the DataSet class by inheriting from it and adding functions that work on the data in the tables. However, since I can't upcast how can I get my base DataSet object assigned an...
5
by: Grant | last post by:
Hello, How come when I add a new row to my dataset table it shows up as changed (agencyData.Haschanges() = True) but when I delete a row the dataset thinks here are no...
3
by: JJ | last post by:
Hi, I need to pass a dataset to another win form along with a SqldataAdapter. I don't want to recreate the SqlDataAdapter again either. So to pass to another Win form in my windows form app, do...
5
by: Jason | last post by:
I am having problems understanding how to access a datasource only once, fill a single dataset, and then reference that dataset multiple times through different user controls(ascx) found on the...
2
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
1
by: matt | last post by:
hello, i have a web app that allows users to query our oracle db and produce a dataset of report data. they then have the option to serialize this data and store it in the database. later, then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.