Posted: 6/10/2011
it gave me this error: Specified argument was out of the range of valid values.Parameter name: index
hihi i am doing a web service and provide to Web site B to consume in the grid view
so basically i bind it with the web service...
i am able to retrieve, update and delete data i consume through web service
however i am not able to add a record through the details view
what i want is from the detail view click on new and key in the record and it will update the grid view
this is my code for insert but it give me error
protected void DV_NewRoll_ItemInserting(object sender, DetailsViewInsertEventArgs e) { //Roll_ID, CallerID and Status are integer Label Roll_ID = (Label)DV_NewRoll.Rows[1].Cells[1].FindControl("Label1"); TextBoxRoll_Data = (TextBox)DV_NewRoll.Rows[2].Cells[2].FindControl("TextBox1"); TextBox DataID = (TextBox)DV_NewRoll.Rows[3].Cells[3].FindControl("TextBox2"); TextBox CallerID = (TextBox)DV_NewRoll.Rows[4].Cells[4].FindControl("TextBox3"); TextBox UserID = (TextBox)DV_NewRoll.Rows[5].Cells[5].FindControl("TextBox4"); TextBox Password = (TextBox)DV_NewRoll.Rows[6].Cells[6].FindControl("TextBox5"); TextBox Return_Status = (TextBox)DV_NewRoll.Rows[7].Cells[7].FindControl("TextBox6"); WsRollInfo.WSRoll inserts = new WsRollInfo.WSRoll(); DV_NewRoll.DataSource = inserts.InsertRoll(Convert.ToInt32(Roll_ID.Text),Roll_Data.Text, DataID.Text, Convert.ToInt32(CallerID.Text), UserID.Text, Password.Text, Convert.ToInt32(Status.Text)); //this is where i bind it back to the gridview BindNominal(); }
it give me this error
Specified argument was out of the range of valid values.Parameter name: index
Posted: 6/11/2011
Hi,You are trying to access something which doesn't even exists. Try to debug line by line in your mentioned code and try look the values of :DV_NewRoll.RowsDV_NewRoll.Rows[1]DV_NewRoll.Rows[1].Cells[1] You will figure out what is the issue.Thanks,Raghav