tq for response. im sorry. i was new here..
like this.
this is my simple form. (please dont comment it) just practice. im going to put data at both textbox above save button.
then i want to login back data from both textbox data below button save. Im looking the coding that can i write at login button. This is my coding. :
Imports System.Data.SqlClient
Public Class Testing
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveLoginButton.Click
If SaveNameTextBox.Text = "" Then
MsgBox("Please fill the Name", _
MsgBoxStyle.OkOnly, _
"Empty")
ElseIf SavepassTextBox.Text = "" Then
MsgBox("Please fill the Password", _
MsgBoxStyle.OkOnly, _
"Empty")
Else
obj_Sys.DB.SQL_INSERT(String.Format("Insert into Tbl_SysTestingSave(name,password) values ('{0}','{1}')", SaveNameTextBox.Text, SavepassTextBox.Text))
MessageBox.Show("Data Save")
End If
End Sub
Private Sub LoginButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginButton.Click
Dim ds As New DataSet
If NameLoginTextbox.Text = "" Then
MsgBox("Please fill the Name", _
MsgBoxStyle.OkOnly, _
"Empty")
ElseIf loginPasswordTextBox.Text = "" Then
MsgBox("Please fill the Password", MsgBoxStyle.OkOnly, "Empty")
End If
End Sub
Private Sub SaveInfoButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveInfoButton.Click
Dim ds As New DataSet
' '' obj_Sys.DB.SQL_INSERT(String.Format("Insert into Tbl_SysTestingSave(name,password) values ('{0}','{1}')", SaveNameTextBox.Text, SavepassTextBox.Text))
If InfoNameTextBox.Text = "" Then
MsgBox("Please fill the Name", _
MsgBoxStyle.OkOnly, _
"Empty")
ElseIf InfoICTextBox.Text = "" = "" Then
MsgBox("Please fill the IC", _
MsgBoxStyle.OkOnly, _
"Empty")
Else
obj_Sys.DB.SQL_SELECT("SELECT ISNULL(MAX(ID),0)+1 AS ID FROM Tbl_SysTestingInfo", ds)
obj_Sys.DB.SQL_INSERT(String.Format("Insert into Tbl_SysTestingInfo(ID,Name,IC) values ('{0}','{1}','{2}')", ds.Tables(0).Rows(0).Item(0), InfoNameTextBox.Text, InfoICTextBox.Text))
MessageBox.Show("Data Save")
End If
End Sub
End Class