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

In my project I am using combobox which is Get the Values from database
DataTextField- Name
DataValueField-Code

When I select the combobox the values is correctly saved.
And then I retrieve the values from database like following
cmbprice.SelectedValue = dt.Rows[0]["LM_PRISELIST"].ToString();


This is Getting the Correct values, But it is not assigned to the values. It is not changing the combobox selectedvalue. But I check using following coding
string str=dt.Rows[0]["LM_PRISELIST"].ToString();


But when I assigned to the combobox, the value is not changing. I didn't Know What is the Problem?

Please help me
Posted

1 solution

hai,
try this

cmbprice.Text= dt.Rows[0]["LM_PRISELIST"].ToString();
 
Share this answer
 
Comments
devausha 16-Jun-12 7:07am    
But I am using Values dt.Rows[0]["LM_PRISELIST"].ToString(); is dataTextValue Field

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