Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai,

I have a dropdownlist and bind it with datasource after that i am populating textboxes when a select value in dropdownlist..example when i select customername in dropdownlist populating his details in textboxes..my problem is ive inserted

ddlNameOfCustomer.Items.Insert(0, new ListItem("--Select--", "0"));

when i select this --select-- i am getting no rows at position 0 erro..

please help if anybody knows
Posted
Updated 30-Aug-11 1:47am
v2
Comments
Prerak Patel 30-Aug-11 7:50am    
Show the code how you are displaying details in textbox.

C#
txtDistrict.Text = ds.Tables[0].Rows[0][0].ToString();
               txtFullAddress.Text = ds.Tables[0].Rows[0][1].ToString()
 
Share this answer
 
Hi anand,
Go through this link
Click Here
Have a good time!!
 
Share this answer
 
Comments
anand kumbham 30-Aug-11 8:58am    
dropdown value i am passing in query retrieving respect values and populating those in textboxes.. the prblm is when i select --select--in dropdown list its getting error becoz it does not have any data in database right!
srinivas vadepally 30-Aug-11 9:13am    
protected void ddlCid_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlCid.SelectedIndex != 0)
{
//write ur code
}
}

It helps you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900