Compiler Error Message: CS0266: Cannot implicitly convert type 'long' to 'int'. An explicit conversion exists (are you missing a cast?) Source Error: Line 270: Line 271: Line 272: n_sno = Convert.ToInt64(((TextBox)(row.Cells[1].Controls[0])).Text); Line 273: n_date = ((TextBox)(row.Cells[2].Controls[1])).Text.Trim(); Line 274: n_c_ref = ((TextBox)(row.Cells[3].Controls[2])).Text.Trim(); Source File: c:\Users\bhushan.COMTEK\Desktop\Halo Convert in Publication\PublicationWeb\Indent.aspx.cs Line: 272
protected void grid_indent_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { // retrieve the table from the session object... // DataTable dt = (DataTable)Session["grid_value"]; // update the values of grid... List<item_list> objList = (List<item_list>)Session["listdata"]; GridViewRow row = grid_indent.Rows[e.RowIndex]; o_sno = objList[row.DataItemIndex].serialnumber; o_date = objList[row.DataItemIndex].date; o_c_ref = objList[row.DataItemIndex].coderef; o_i_name = objList[row.DataItemIndex].item_name; o_inhand = objList[row.DataItemIndex].inhand; o_request = objList[row.DataItemIndex].newrequest; o_rate = objList[row.DataItemIndex].rate; o_amt = objList[row.DataItemIndex].amount; n_sno = Convert.ToInt16(((TextBox)(row.Cells[1].Controls[0])).Text); n_date = ((TextBox)(row.Cells[2].Controls[1])).Text.Trim(); n_c_ref = ((TextBox)(row.Cells[3].Controls[2])).Text.Trim(); n_i_name = ((TextBox)(row.Cells[4].Controls[3])).Text.Trim(); n_inhand = Convert.ToInt32(((TextBox)(row.Cells[5].Controls[4])).Text.Trim()); n_request = Convert.ToInt32(((TextBox)(row.Cells[6].Controls[5])).Text.Trim()); n_rate = ((TextBox)(row.Cells[7].Controls[6])).Text.Trim(); n_amt = ((TextBox)(row.Cells[8].Controls[7])).Text.Trim(); objList[row.DataItemIndex].serialnumber =n_sno; objList[row.DataItemIndex].date = n_date; objList[row.DataItemIndex].coderef = n_c_ref; objList[row.DataItemIndex].item_name = n_i_name; objList[row.DataItemIndex].inhand = n_inhand; objList[row.DataItemIndex].newrequest = n_request; objList[row.DataItemIndex].rate = n_rate; objList[row.DataItemIndex].amount = n_amt; grid_indent.EditIndex = -1; popUpData(); } catch (Exception ex) { Response.Write(ex.Message); } finally { } }
n_sno = Convert.ToInt64(((TextBox)(row.Cells[1].Controls[0])).Text);
n_sno
int
Convert.ToInt32()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)