i having a probelm editing data on a datatable . i have loaded data into a datatable and some clounms got null value which i placed that in an on the SP now i want to edit some clounms in the datatble
dt1 = AuthWorkdone.View_AuthorsationReport_WorkDone1(DateTime.Parse(txtStart.Text.Trim()), DateTime.Parse(txtEnd.Text.Trim()));
if ( dt1.Rows.Count >0 ) {
foreach(DataColumn col1 in dt1.Columns) {
col1.ReadOnly = false; }
}
foreach ( DataRow row1 in dt1.Rows) {
DataTable dtQuote1 = new DataTable();
dtQuote1.Clear();
DataTable dtAuthdetails1 = new DataTable();
dtAuthdetails1.Clear();
dtQuote1 = AuthWorkdone.View_AuthorsationReport_WorkDone7(row1["Internal Reference"].ToString());
if (dtQuote1.Rows.Count > 0) {
row1.SetField("Quote Amount", Decimal.Parse(AuthWorkdone.View_AuthorsationReport_WorkDone8(row1["Internal Reference"].ToString(),
dtQuote1.Rows[0][0].ToString()).Rows[0][0].ToString()));
dtAuthdetails1 = AuthWorkdone.View_AuthorsationReport_WorkDone9(row1["Internal Reference"].ToString(), dtQuote1.Rows[0][0].ToString());
if (dtAuthdetails1.Rows.Count > 0)
{
if (dtAuthdetails1.Rows[0][3].ToString().Equals("T.B.A"))
{
row1.SetField("Excess", "T.B.A");
row1.SetField("Authorisation Date",DateTime.Parse(dtAuthdetails1.Rows[0][0].ToString()));
row1.SetField("Authorisation Amount", Decimal.Parse(dtAuthdetails1.Rows[0][1].ToString()));
}
the cloumn "Excess" in the table is varchar
i am getting the following error on this line of code
Cannot set column 'Excess'. The value violates the MaxLength limit of this column.
row1.SetField("Excess",dtAuthdetails1.Rows[0][3].ToString().ToString());
please can you help the columns has numbers like 0.00 or 500.00 and also words like TBA and ect