急救!!120...VB.NET问题
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...因为我换了也不行!我的程序里每个页面全是这种错误我已经倒了。!!!!谢谢告诉我。。。。。