Click here to Skip to main content
15,906,467 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can i add a new record in database with datagridview.
i work with visual studio 2010.
i need in vb.net or c#.
please help me.
thankyou
Posted

Hi ,
Check this
Editable GridView in ASP.NET 2.0[^]
http://www.c-sharpcorner.com/uploadfile/anjudidi/example-of-datagrid-in-Asp-Net/[^]
You will find what you looking for
Google[^]
Best Regards
M.Mitwalli
 
Share this answer
 
To Add data from Grid View have input controls in Grid Footer and set ShowFooter to Ture
and have Button give Commond Name, In RowCommond event use following logic..
C#
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
    if (e.CommandName == "AddItem")
    {
        // find the required controls from the footer item
        Control controlRefName = GridView1.FooterRow.FindControl("controlID") as Control;
        .
        .
  
        // Do your insert logic here..
    }
}
 
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