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 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-21-2007, 12:46 AM
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
Sponsored Links
  #2 (permalink)  
Old 07-21-2007, 01:12 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
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 On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-programming/2401-how-create-datatable-very-useful-binding.html
Posted By For Type Date
How to create Datatable which is very useful in binding.. | Web Hosting This thread Refback 12-13-2007 01:50 AM

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


All times are GMT -7. The time now is 07:57 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0