Click here to Skip to main content
15,920,031 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
I have developing window application using C# coding...
In that i want how to pass from textvalue to grid without saving database...


please anyone help me with coding....
Posted

1 solution

Hi,

Use like this,

C#
DataTable dt = new DataTable();
        DataColumn dc = new DataColumn("name");
        dt.Columns.Add(dc);
        dc = new DataColumn("field");
        dt.Columns.Add(dc);
//Now your table has defined columns
// you can add rows...
 
        DataRow dr = dt.NewRow();
        dr["Name"] = TextBox1.Text;
        dr["field"] = TextBox2.Text;
 
        GridView1.DataSource = dt;
        GridView1.DataBind();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900