when i am saving the grid i got the extra row as the empty string so i dont want to save that one what i have to do?
suppose i am taking i=0,i<7......so i getting empty rows also in the save section ?in windows application
for (int i = 0; i < 7; i++)
{
dgvpayscdule.Rows.Add();
string particular = "";
if (i == 0) particular = "On Booking : ";
if (i == 1) particular = "On Commencement of Civil Work:";
if (i == 2) particular = "On Casting of Basement Slab: ";
if (i == 3) particular = "On Casting of G Floor Slab:";
if (i == 4) particular = "On Casting of 1st Floor Slab:";
if (i == 5) particular = "On Casting of 2nd Floor Slab: ";
if (i == 6) particular = "On Possession: ";
dgvpayscdule.Rows[i].Cells[1].Value = particular;
string result_query = "";
for (int i = 0; i < dgvpayscdule.Rows.Count; i++)
{
result_query += "'" + Convert.ToString(dgvpayscdule[3, i].Value) + "'" + ",";
}
result_query = result_query.TrimEnd(',');
string str_query_paySchedules = "insert into AdvitPM_BookingPaymentSchedule(BookingID,CustomerId,onBooking,onCommencementofCivilWork,onCastingofBasementSlab,onCastingofGFloorSlab,onCastingofFirstFloorSlab,onCastingofsecondFloorSlab,onPossession,createddate,createdby,status)";
str_query_paySchedules += " values(" + objbooikng.BookingID + "," + objbooikng.CustomerID + "," + result_query + ",'" + objbooikng.CreatedDate + "','" + objbooikng.CreatedBy + "','" + objbooikng.Status + "')";
OdbcCommand cmd1 = new OdbcCommand(str_query_paySchedules, con);
cmd1.Transaction = trans;
cmd1.ExecuteNonQuery();