How to bind table coloum with gridview column

Answer Posted / eyesice

DataTable dt = new DataTable("Sample");
DataColumn dc;

dc = new DataColumn("ID");
dc.DataType = System.Type.GetType("System.Int32");
dt.Columns.Add(dc);

dc = new DataColumn("Name");
dc.DataType = System.Type.GetType("System.String");
dt.Columns.Add(dc);

dataGridView1.DataSource = dt;

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is .net framework dead?

529


what is split entity?

599


I want ask from plz smaple example code for Biztalkk server

1704


How we can handle the exception at controller level in ASP.Net MVC?

562


What is attribute routing in mvc?

573






Describe the gac in the .net framework.

568


What are the options can be configured in AJAX helpers?

581


If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

1968


Are there any parts of the .net framework 3.0 that only work on windows vista?

555


explain how you can load related entities in ef (entity framework)?

535


Can you please explain the request flow in ASP.NET MVC framework?

617


I have 2+ years of fake experience,actually i could not answer for project questions..?how can i answer please suggest me..?

2642


What is the importance of NonActionAttribute?

603


How would you deploy your old applications with .net framework 4.0? Are the old applications compatible?

478


How to use multiple submit buttons in asp.net mvc?

571