vb 怎么得到combobox当前选定的值
我用鼠标选择了combobox的值,那怎么我怎么获得这个值呢?用Combobox.Text好像不对啊,我的代码如下,多谢啊DimMyBNameAsObject=Combo...
我用鼠标选择了combobox的值,那怎么我怎么获得这个值呢?用Combobox.Text好像不对啊,我的代码如下,多谢啊
Dim MyBName As Object = ComboBox1.Text
Dim MyName As Object = ComboBox2.Text
Dim mySql As String = "select * from " + MyBName + " where 名 ='" + MyName + "'" 展开
Dim MyBName As Object = ComboBox1.Text
Dim MyName As Object = ComboBox2.Text
Dim mySql As String = "select * from " + MyBName + " where 名 ='" + MyName + "'" 展开
2个回答
展开全部
Dim MyBName As Object = ComboBox1.Text
Dim MyName As Object = ComboBox2.Text
Dim mySql As String = "select * from " + MyBName + " where 名 ='" + MyName + "'"
TextBox1.Text = mySql
VB 2005通过。
Dim MyName As Object = ComboBox2.Text
Dim mySql As String = "select * from " + MyBName + " where 名 ='" + MyName + "'"
TextBox1.Text = mySql
VB 2005通过。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim MyBName As string
mybmane= ComboBox1.Text
Dim MyName As string
myname= ComboBox2.Text
Dim mySql As String
mysql= "select * from " + MyBName + " where 名 ='" + MyName + "'"
mybmane= ComboBox1.Text
Dim MyName As string
myname= ComboBox2.Text
Dim mySql As String
mysql= "select * from " + MyBName + " where 名 ='" + MyName + "'"
更多追问追答
追问
这样不行的,其实你的写法和我上面写的一样,这样不行,还有别的吗,谢谢啊
追答
这样,肯定可以的,你是哪一句出错?错误提示是什么?
Dim MyBName As String
MyBName = Combo1.Text
Dim MyName As String
MyName = Combo2.Text
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询