| 发表于:2007-05-08 11:00:5515楼 得分:90 |
' 您先试试吧,您那段程序看来有年头了 private sub _command1_0_click(byval sender as system.object, byval e as system.eventargs) handles _command1_0.click dim strsql as string dim cn as new sqlclient.sqlconnection dim rs as new dataset cn.connectionstring = "provider=computer;data source=new;initial catalog=northwind;user id=sa;password=; " ' 不知道这个 "provider=computer "对不对,您是从书上看来的吧 cn.open() ' rs.cursorlocation = aduseclient ' 不知道这一句的用处 strsql = "select 密码 from new where 登录名= ' " & 用户登录_renamed.text & " ' " ' rs.open(strsql, cn, adopenstatic, adlockreadonly) dim da as new sqlclient.sqldataadapter(strsql, cn) dim count as int32 = da.fill(rs) if count = 0 then msgbox( "用户名不正确 ") else if rs.tables(0).rows(0)(0).value = text1.text then msgbox( "登录成功 ") else msgbox( "密码错误 ") end if end if end sub | | |
|