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

What are the levels at which filters can be applied in an asp.net mvc application?

586


What is .net framework & its benefits?

518


Explain what is asp.net mvc?

654


What is the difference between renderaction and renderpartial?

616


What is the use of display modes?

577






Is mvc 4 supporting windows azure sdk (software development kit) ?

554


What is the .net framework and how does it work?

559


What you mean by routing in asp.net mvc?

539


How to change the action name in mvc?

542


what is eager loading?

571


What is the difference between partial and renderpartial?

493


Is .net core replacing .net framework?

467


What are the advantages of asp.net mvc?

557


What is web api‘s in asp.net mvc 4 ?

582


Explain covariance and contra-variance in .net framework 4.0. Give an example for each.

573