B M Suchitra

B M Suchitra

  • NA
  • 507
  • 413.6k

ColumnName does not allow nulls

Aug 24 2011 6:25 AM
Hi,

Plzz look at the code below:

if (menuType == "city")
        {

            DataSet DSLoadMaster = obj.LoadDataSet("Select * from city_master");
            // Here we'll add a blank row to the returned DataTable
            DataTable DT = DSLoadMaster.Tables[0];
            DataRow DR = DT.NewRow();
            DT.Rows.InsertAt(DR,0);
            //Creating the first row of GridView to be Editable
            GVDetails.EditIndex = 0;
            GVDetails.DataSource = DT;
            GVDetails.DataBind();
        }


i am trying to insert a new row in gridview which has dynamically created bound fields. I get an error cityname doe not allow null values..

Answers (2)