IT Community - Software Programming, Web Development and Technical Support

How to create Datatable which is very useful in binding..

This is a discussion on How to create Datatable which is very useful in binding.. within the C# Programming forums, part of the Software Development category; How to create Datatable which is very useful in binding the desired set values from the table to many controls ....


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-20-2007, 11:46 PM
Archer Archer is offline
D-Web Programmer
 
Join Date: Jun 2007
Posts: 52
Archer is on a distinguished road
Question How to create Datatable which is very useful in binding..

How to create Datatable which is very useful in binding the desired set values from the table to many controls .Net ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 07-21-2007, 12:12 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
oxygen is on a distinguished road
Thumbs up Re: How to create Datatable which is very useful in binding..

Hi.. We have to create the datatable as below..

DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Id", typeof(int)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
DataRow dr;
dr = dt.NewRow();

dr[0] = 0;
dr[1] = "Select a Category";
dt.Rows.Add(dr);
for (int i = 0; i < argCategory.Length; i++)
{
dr = dt.NewRow();
dr[0] = argCategory[i].Id;
dr[1] = argCategory[i].Name;
dt.Rows.Add(dr);
}
DataView dv = new DataView(dt);
return dv;
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort Datatable oxygen C# Programming 2 04-22-2008 09:25 PM
Late binding and Early binding vigneshgets C# Programming 2 08-01-2007 04:31 AM
data binding nssukumar Flash Actionscript Programming 0 03-21-2007 01:58 AM
Data binding nssukumar Flash Actionscript Programming 0 03-16-2007 05:17 AM
note regarding data binding nssukumar Flash Actionscript Programming 0 03-14-2007 08:38 AM


All times are GMT -7. The time now is 09:41 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0