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

pingwenqin 2010-12-29 04:25:49
环境:VB.net,数据库:access
我的界面很简单,3个label,text属性分别为用户名、密码、确认密码,对应有3个textbox;2个button,text属性分别为注册和取消,如何在注册按钮的click事件中编写代码,来实现用户的成功注册呀?
...全文
156 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuyq11 2010-12-29
  • 打赏
  • 举报
回复
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判断空或验证控件
Tosp2012 2010-12-29
  • 打赏
  • 举报
回复
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

16,721

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧