急救!!120...VB.NET问题

fayewang fayewang 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
imports system.data
imports system.data.sqlclient
imports system.nullreferenceexception
public class _default
inherits system.web.ui.page
# region "web 窗体设计器
...简了
dim mycon as sqlconnection
dim mycom as sqlcommand
sub page_load(sender as object,e as eventargs)
if not ispostback then
mycon=new sqlconnection("data source=(local);initial catalog=lyzygl;user id=sa;")
mycom=new sqlcommand("select name,passwd from ydzy",mycon)
end if
end sub
sub button1_click(sender as object,e as eventargs)
mycon.open()
dim dt as SqlDataReader=mycom.ExcuteReader()
while dt.read()
if trim(dt("name"))=trim(textbox1.text) and trim(dt("passwd"))=trim(textbox2.text) then
reponse.redirect("announce.aspx")
end if
dt.read()
end while
message.html="用户不存在或者密码错误!"
end sub
......以下简了....
错误信息为:未将对象引用设置到对象的实例/////
不要叫我换成 datatable...因为我换了也不行!我的程序里每个页面全是这种错误我已经倒了。!!!!谢谢告诉我。。。。。
...全文

相关推荐

评论 8
收藏 已收藏
分享
返回顶部
fayewang
.NET社区 62,272 成员 668,968 内容