标题:我是新手,请达人指点
取消只看楼主
jameshau
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-3-4
 问题点数:0 回复次数:0 
我是新手,请达人指点

Private Sub Button1_Click(ByVal sender as object ,byval e as system.events)Handles Button1.Click

Dim a,b as string
Dim StrConnect as string
Dim StrQuery as string
Dim myConnectStr as string

b=Text1.text

StrQuery="select Name,PWD,Root from UserInformation"
myConnectStr="Driver=SQL........"

Dim myConn as New Odbc.OdbcConnection(myConnectStr)
Dim myCommand as New Odbc.OdbcCommand(StrQuery,myConn)
myConn.Open()

Dim myReader as Odbc.OdbcDataReader

myReader=myCommand.ExecuteReader()

While myReader.Read()
a=myReader.Getstring(0) /myReader.Getstring(0)的值为string类型"James"
if a=b then
Label1.text="相等"
else
Label1.text="不等"
end if
end while
end sub


上面这一段,如果在Text1中输入"James"然后点击Button1的话,Label1显示不等
(此时a的值为“James”);而把a=myReader.GetString(0)改成a="James"后,再点击Button1
,Label1显示“相等”了,这是为什么呢?有什么不同吗?

2006-03-04 15:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-48416-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.074112 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved