Hello Amit
For Saving Data in database table
Use insert query in which values would be from DataGridView Cells .
Use foreach loop to iterate on DataGridView Rows .
like :
int formId = 0 ;
string surname = "" ;
foreach( DataGridViewRow row in yourdatagridviewName.rows)
{
formId = Convert.ToIn32(row.Cells["Column Name / index ").Value) ;
surname = (row.Cells["Column Name / Index ").Value).ToString();
sqlquery = Insert InTo TableName (Id , Name) Values ( formId , surname) ;
other function of database insert command -------- Connection obj , sql command , executeNonquery / etc .
}
this foreach loop will iterate through each row of your datagridview and will fatch data from cell to variables and then you can use them to save in Insert Query .
Hope you will do your work .
one thing more that you can get this type of solution by putting some efforts in googling .