Dim objConn As SqlConnection
Dim objCmd As SqlCommand
Dim strSQL As String
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Sub BindData()
Dim strConnString As String
strConnString = "Server=localhost;database=MyWeb;Max Pool Size=400;Connect Timeout=600;"
objConn = New Data.SqlClient.SqlConnection(strConnString)
objConn.Open()
Dim strSQL As String
strSQL = "INSERT INTO Username (Name,Surname,Username,Password,ConfirmPassword,Email)" & _
" VALUES ('" & txtName.Text & "','" & txtSurname.Text & "','" & txtUsername.Text & "' " & _
" ,'" & txtPassword.Text & "','" & txtConfirmPassword.Text & "','" & txtEmail.Text & "') "
objCmd = New System.Data.SqlClient.SqlCommand()
With objCmd
.Connection = objConn
.CommandType = CommandType.Text
.CommandText = strSQL
End With
objCmd.ExecuteNonQuery()
objCmd = Nothing
objConn.Close()
objConn = Nothing
End Sub
Private Sub btnSubmit_OnClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Messagebox.Show("ยืนยันการลงทะเบียน","Spare Part Directory","MessageBoxButtons.YesNo,_MessageBoxIcon.Information)
Me.lblShowName.Text = "Welcome To [" & Me.lblShowName.Text & "] Sparepart"
End Sub
Tag : .NET, Ms SQL Server 2005, Web (ASP.NET), VB.NET
Private Sub btnSubmit_OnClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Messagebox.Show("ยืนยันการลงทะเบียน","Spare Part Directory","MessageBoxButtons.YesNo,_MessageBoxIcon.Information)
Me.lblShowName.Text = "Welcome To [" & Me.lblShowName.Text & "] Sparepart"
Call BindData()
End Sub