I have DropDownList and few text boxes . Showing error... Invalid Argument
protected void btnSelect_Click(object sender, EventArgs e)
{
LabTestClass LB = new LabTestClass();
DataTable dtn = LB.ShowRec(DP1.SelectedItem.Value);
tbId.Text = dtn.Rows[0]["ID"].ToString();
tbName.Text = dtn.Rows[0]["Name"].ToString();
tbDesig.Text=dtn.Rows[0]["Desgn"].ToString();
at dropdownlist
I have sqldb with ID Autogenrated which I m bind to DRopdown..
based on selected value..it show records from db.....
Plz help....
Sanjeeb LenkaPosted Sep 2, 2013, 4:50 AM
share your dropdownlist bind code.
Aman JenPosted Sep 2, 2013, 4:22 AM
Input string was not in a correct format.
Aman JenPosted Sep 2, 2013, 4:20 AM
Aman JenPosted Sep 2, 2013, 4:13 AM
Aman JenPosted Sep 2, 2013, 4:10 AM
Prasenjit DeyPosted Sep 2, 2013, 4:05 AM
protected void btnSelect_Click(object sender, EventArgs e)
{
LabTestClass LB = new LabTestClass();
DataTable dtn = LB.ShowRec(DP1.SelectedValue);
tbId.Text = dtn.Rows[0]["ID"].ToString();
tbName.Text = dtn.Rows[0]["Name"].ToString(); tbDesig.Text=dtn.Rows[0]["Desgn"].ToString();
}
Posted Sep 2, 2013, 4:02 AM
How many records are retrieved from the database ?
What is the value of dtn.Rows.Count?
Sanjeeb LenkaPosted Sep 2, 2013, 4:02 AM
plz provide ShowRec() function code.
As i think id is int in your function. if its correct try this:
DataTable dtn = LB.ShowRec(Convert.ToInt32(DP1.SelectedItem.Value));
Kunal VaishyaPosted Sep 2, 2013, 4:02 AM