Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

filling values into dataset

Posted on 2005-03-16
1
Medium Priority
?
252 Views
Last Modified: 2010-04-16
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
0
Comment
Question by:ccoe1
1 Comment
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 200 total points
ID: 13554146
DataSet myDataSet = new DataSet("NewDataSet");
                  DataTable tblUserData = new DataTable("tblUserData");
                  tblUserData.Columns.Add("User_Name", typeof(string));
                  myDataSet.Tables.Add(tblUserData);

                  DataRow rw;
                  rw = tblUserData.NewRow();
                  rw["User_Name"] = "Mohammed";
                  tblUserData.Rows.Add(rw);
                  
                  // just add this for testing
                  dataGrid1.DataSource = tblUserData;
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question