use
sqlbulkcopy for save grid data into database.
Steps :
1. Save Griddata into datatable
2. Use sqlbulkcopy to insert data
public bool InserData(DataTable insertDt)
{
using (SqlConnection objConn = new SqlConnection(objDBTrans.ConnectionString))
{
objConn.Open();
using (SqlBulkCopy objBulkCopy = new SqlBulkCopy(objConn.ConnectionString, SqlBulkCopyOptions.FireTriggers))
{
objBulkCopy.DestinationTableName = "real_Propertytype";
objBulkCopy.ColumnMappings.Add("Code", "code");
objBulkCopy.WriteToServer(insertDt);
objConn.Close();
return true;
}
}
return false;
}
I hope this is helpful for u ...:thumbsup:
Arvind Wanjari....