how to insert new row in gridview at design time?
i want to insert new record in gridview at runtime?
Status:
Open Dec 28, 2008 - 07:00 PM
gridview, rows
4answers
Answers
Mar 12, 2009 - 04:23 AM
SqlConnection connection = new SqlConnection(connection string);
connection.Open();
string sql = "insert into table_name values('','','','','');
SqlDataAdapter dp = new SqlDataAdapter(sql, connection);
DataSet ds = new DataSet();
dp.Fill(ds);
grid_name.DataBind();
connection.Close();
Mar 12, 2009 - 08:40 PM
thankyou for your response.this codings is used to bind the table in gridview i want to insert new row in datatable at design its possible?
Mar 13, 2009 - 12:12 AM
try this one
string sql = "SELECT * FROM TeamMember_table";
SqlDataAdapter dp = new SqlDataAdapter(sql, connection);
DataSet ds = new DataSet();
dp.Fill(ds);
DataTable table = ds.Tables[0];
table.Rows.Add("", "", ..., "")
Mar 20, 2009 - 04:33 AM
thankyou thiru.
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment