I have this...
foreach (GridViewRow dgi in BookingList.Rows)
{
CheckBox Update = (CheckBox)BookingList.FindControl("CheckBoxUpdate");
DropDownList ModelNumber = (DropDownList)BookingList.FindControl("ddlList");
TextBox PriKey = (TextBox)BookingList.FindControl("PriKey");
string ModelNo = ModelNumber.SelectedItem.Value;
string PrimKey = PriKey.Text;
int Key = Convert.ToInt32(PrimKey);
if (Update.Checked)
{
SQLQueries.UpdateApp(ModelNo, Key);
}
}
but I'm getting this....
Object reference not set to an instance of an object. on the following line...string ModelNo = ModelNumber..SelectedItem.Value
Thanks,
Stelly
foreach (GridViewRow dgi in BookingList.Rows)
{
CheckBox Update = (CheckBox)BookingList.FindControl("CheckBoxUpdate");
DropDownList ModelNumber = (DropDownList)BookingList.FindControl("ddlList");
TextBox PriKey = (TextBox)BookingList.FindControl("PriKey");
string ModelNo = ModelNumber.SelectedItem.Value;
string PrimKey = PriKey.Text;
int Key = Convert.ToInt32(PrimKey);
if (Update.Checked)
{
SQLQueries.UpdateApp(ModelNo, Key);
}
}
but I'm getting this....
Object reference not set to an instance of an object. on the following line...string ModelNo = ModelNumber..SelectedItem.Value
Thanks,
Stelly