473,320 Members | 2,092 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,320 software developers and data experts.

filling values into dataset

Hi there,
I created a DataSet manually like this:

DataSet myDataSet = new DataSet("NewDataSet");
DataTable tblUserData = new DataTable("tblUserData");
tblUserData.Columns.Add("User_Name", typeof(string));
myDataSet.Tables.Add(tblUserData);

How can I add manually a value to the column "User_Name"?

Thanks heaps

Chris
Nov 16 '05 #1
2 1062
Hi Chris,

DataRow row = tblUserData.NewRow;
// myDataSet.Tables["tblUserData"].NewRow;

row["User_Name"] = "Hello World";

tblUserData.Rows.Add(row);
// myDataSet.Tables["tblUserData"].Rows.Add(row);
On Wed, 16 Mar 2005 02:29:03 -0800, chris
<ch***@discussions.microsoft.com> wrote:
Hi there,
I created a DataSet manually like this:

DataSet myDataSet = new DataSet("NewDataSet");
DataTable tblUserData = new DataTable("tblUserData");
tblUserData.Columns.Add("User_Name", typeof(string));
myDataSet.Tables.Add(tblUserData);

How can I add manually a value to the column "User_Name"?

Thanks heaps

Chris


--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
Thanks Morten,

it works like a dream

"Morten Wennevik" wrote:
Hi Chris,

DataRow row = tblUserData.NewRow;
// myDataSet.Tables["tblUserData"].NewRow;

row["User_Name"] = "Hello World";

tblUserData.Rows.Add(row);
// myDataSet.Tables["tblUserData"].Rows.Add(row);
On Wed, 16 Mar 2005 02:29:03 -0800, chris
<ch***@discussions.microsoft.com> wrote:
Hi there,
I created a DataSet manually like this:

DataSet myDataSet = new DataSet("NewDataSet");
DataTable tblUserData = new DataTable("tblUserData");
tblUserData.Columns.Add("User_Name", typeof(string));
myDataSet.Tables.Add(tblUserData);

How can I add manually a value to the column "User_Name"?

Thanks heaps

Chris


--
Happy Coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #3

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

Similar topics

2
by: ramesh | last post by:
hi, I am using Com+ in my application. It will have InsertRecords,selectRecords,updateRecords function. In the Web Form i have Drop-down list. I want to select records from SQL and add it to this...
4
by: Michael Jones | last post by:
Ok.......... I'm trying to fill a parameterized table onto a Dataset via a sqlDataAdapter. It works fine if I fill the Dataset with all the column fields. What I want to do though is to only fill...
5
by: Cybertof | last post by:
Hello, Is it necessary to initially fill a dataset to be able to add a new row to the dataset and then update the undercover database ? (In the case of a very large database, this would mean...
1
by: Krzysztof Karnicki | last post by:
I have such a problem… I have create my custom DataGridColumn inheriting from System.Windows.Forms.DataGridColumnStyle on using it on DataGrid, to show rows painted by me self. Because dates ...
0
by: AMeador | last post by:
I am new to writing apps that use a database in general and in .NET. I have read about how to use SqlCommands and executing strait SQL for inserts, selects, etc... I have also read about datasets &...
2
by: Paul | last post by:
I'm trying to use the Duwamish 7.0 Framework to make a distributed application. I re-wrote parts of the application to work with Students instead of Customers. So instead of a unique email...
3
by: crjunk | last post by:
I have a 3 table in my DataSet that I'm filling with data. After I've filled these 3 tables, I'm then trying to run a query that will fill a 4th table in the DataSet with data from the three...
5
by: Jean Christophe Avard | last post by:
Hi! I have a query that INNER JOIN's three other tables. All the relation are 1 to 1, except for one, where an Item can have more than one price. I have this query that work fine in MSDE Query...
0
by: Derek Vincent | last post by:
Why am I having problems filling my dataset when I select fields of type varchar(350) from interbase? I can fill the dataset when I select every other field in the table but I receive and error...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.