不能在XP中填充组合框 [英] cant populate comboboxes in XP

查看:66
本文介绍了不能在XP中填充组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我加载我的窗体时,我填充一个组合框我使用下面的代码


Dim conn As New System.Data.SqlClient.SqlConnection(strConn)

Dim sql As String =" AllLenders"

Dim da As New System.Data.SqlClient.SqlDataAdapter(sql,conn)

Dim ds As New DataSet()

da.Fill(ds)

ComboBox1.DataSource = ds.Tables(0)

ComboBox1.DisplayMember =" Lender"

da.Dispose()

ds.Dispose()

此代码在我的win2k盒子上编译并完美运行

现在当有人接受我编译的可执行文件并在

windows xp上运行时,组合框没有填充!


我也尝试在windows xp框中编译它并且它仍然没有

工作


sql字符串是一个存储过程


我非常渴望得到帮助这就像我撞到了一堵砖墙!


谢谢


Mike Fellows

when i load my windows form i populate a combobox i use the code below

Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
Dim sql As String = "AllLenders"
Dim da As New System.Data.SqlClient.SqlDataAdapter(sql, conn)
Dim ds As New DataSet()
da.Fill(ds)
ComboBox1.DataSource = ds.Tables(0)
ComboBox1.DisplayMember = "Lender"
da.Dispose()
ds.Dispose()
This code compiles and works perfectly on my win2k box
now when someone takes my compiled executable and runs it on
windows xp, the combobox is not populated!

Ive also tried compiling it on a windows xp box and it still does not
work

the sql string is a stored procedure

im desperate for help with this as ive hit a brick wall!

Thanks

Mike Fellows

推荐答案

不知道是不是这样但是

你将组合绑定到数据集然后处理数据集

unles有人有一个更好的解决方案看看那个方向


希望它有所帮助


eric


" ; Mike Fellows < MI *************** @ equityhouse.co.uk>在消息中写道

news:7o0%b.959
don''t know if this is it but
you bind the combo to a dataset and then dispose the dataset
unles someone has a better sollution have a look in that direction

hope it helps

eric

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:7o0%b.959


44.378@newsfe1-win ...
44.378@newsfe1-win...
当我加载我的窗口时表单我填充一个组合框我使用下面的代码

Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
Dim sql As String =" AllLenders"
Dim da As New System.Data.SqlClient.SqlDataAdapter(sql,conn)
Dim ds As New DataSet()
da.Fill(ds)
ComboBox1.DataSource = ds.Tables(0)
ComboBox1.DisplayMember =" Lender"
da.Dispose()
ds.Dispose()

此代码在我的win2k盒子上编译并完美运行
现在当有人接受我编译的可执行文件并在
windows xp上运行时,组合框没有填充!

我也试过在windows xp框上编译它仍然没有<工作

sql字符串是一个存储过程

我迫切希望得到帮助,因为我打了一堵砖墙!

谢谢

Mike Fell ows
when i load my windows form i populate a combobox i use the code below

Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
Dim sql As String = "AllLenders"
Dim da As New System.Data.SqlClient.SqlDataAdapter(sql, conn)
Dim ds As New DataSet()
da.Fill(ds)
ComboBox1.DataSource = ds.Tables(0)
ComboBox1.DisplayMember = "Lender"
da.Dispose()
ds.Dispose()
This code compiles and works perfectly on my win2k box
now when someone takes my compiled executable and runs it on
windows xp, the combobox is not populated!

Ive also tried compiling it on a windows xp box and it still does not
work

the sql string is a stored procedure

im desperate for help with this as ive hit a brick wall!

Thanks

Mike Fellows



Nah,


没有处理数据集没有任何区别


所以我仍然像以前一样陷入困境

" EricJ" < ER ******** @ ThiSbitconsult.be.RE>在消息中写道

news:40 ********************* @ news.skynet.be ...
Nah,

didnt make any difference not disposing of the dataset

so im still as stuck as i was before
"EricJ" <er********@ThiSbitconsult.be.RE> wrote in message
news:40*********************@news.skynet.be...
不知道是不是这样但是你将组合绑定到数据集然后处理数据集
unles有人有一个更好的解决方案看看那个方向

希望它有所帮助



Mike Fellows < MI *************** @ equityhouse.co.uk>在消息中写道
新闻:7o0%b.959
don''t know if this is it but
you bind the combo to a dataset and then dispose the dataset
unles someone has a better sollution have a look in that direction

hope it helps

eric

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:7o0%b.959


这篇关于不能在XP中填充组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆