在组合框中更改值的问题 [英] Problem to change the value in combobox
问题描述
海,
在我的项目中,我使用的是combobox,即从数据库获取值
DataTextField-名称
DataValueField-Code
当我选择组合框时,值已正确保存.
然后我从数据库中检索值,如下所示:
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
推荐答案
hai,
试试这个
cmbprice.Text = dt.Rows [0] ["LM_PRISELIST"].ToString();
hai,
try this
cmbprice.Text= dt.Rows[0]["LM_PRISELIST"].ToString();
这篇关于在组合框中更改值的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!