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....

Kunal VaishyaRank #990 · 2K reputationPosted Sep 2, 2013, 12:02 AM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 2, 2013, 12:02 AM EDT
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));
Posted Sep 2, 2013, 12:02 AM EDT
How many records are retrieved from the database ?
What is the value of dtn.Rows.Count?
Prasenjit DeyRank #6,279 · 271 reputationPosted Sep 2, 2013, 12:05 AM EDT
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();
}
Aman Jen136 reputationPosted Sep 2, 2013, 12:10 AM EDT
Aman Jen136 reputationPosted Sep 2, 2013, 12:13 AM EDT
Aman Jen136 reputationPosted Sep 2, 2013, 12:20 AM EDT
Aman Jen136 reputationPosted Sep 2, 2013, 12:22 AM EDT
Input string was not in a correct format.
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 2, 2013, 12:50 AM EDT
share your dropdownlist bind code.