当前位置:编程学习 > C#/ASP.NET >>

用VB.net2005设计用户注册界面

环境:VB.net,数据库:access
我的界面很简单,3个label,text属性分别为用户名、密码、确认密码,对应有3个textbox;2个button,text属性分别为注册和取消,如何在注册按钮的click事件中编写代码,来实现用户的成功注册呀? --------------------编程问答-------------------- dim strCmd as string
註冊:
if txtUsername="" then
exit sub
end if
if txtPassword.text="" or txtPassword.text<>txtRePassWord.text then
exit sub
end if

OLEConn = New OleDb.OleDbConnection(strConn)
OleConn.open
strcmd="insert into 用戶表 (用戶名,密碼) values ('" & txtUserName.text &"','" & txtPassWord.text & "')"
OLeCommand = New OleDb.OleDbCommand(strCmd,Oleconn)
OleCommand.ExecuteNonQuery()
Oleconn.Close --------------------编程问答-------------------- Using OleConn As New OleDbConnection(strConn)
  OleConn.Open()
  Dim sql As [String] = "INSERT INTO table value('','','')"
  Dim mycommand As OleDbCommand = New OleDbCommand(sql, OleConn )
  mycommand.ExecuteNonQuery()

  OleConn.Close()
End Using
使用 string.isnullotempty判断空或验证控件
补充:.NET技术 ,  VB.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,