android大作业源代码,大作业源代码.doc

大作业源代码

源代码如下:

sub page_load(sender as object,e as eventargs)

end sub

sub checkuser(sender as object,e as eventargs)

dim conn as Sqlconnection

dim querystring as string

querystring="select * from userinfo where(username='"+username.text+"' and userpassword='"+password.text+"')"

conn=new Sqlconnection("Data Source=(local);user id=bbs;password=bbs;Initial Catalog=bbs")

dim ds as dataset=new dataset

dim mycommand as SqlDataAdapter=new SqlDataAdapter(querystring,conn)

mycommand.fill(ds)

mydatagrid.datasource=new dataview(ds.tables(0))

mydatagrid.databind()

if mydatagrid.items.count=0 then

statues.style("color")="red"

statues.text="登录失败,请检查用户名和密码!"

conn.close()

else

conn.close()

dim username as string=ds.tables(0).rows(0).item(1)

dim userhead as string=ds.tables(0).rows(0).item(3)

session("username")=username

session("userhead")=userhead

response.redirect("bbs.aspx")

end if

end sub

   
 
在线论坛

你可能感兴趣的:(android大作业源代码)