The problem is in lies in TA.Insert(txtfirst.text)
I really dont know what is parameter,,,,all about
pls help me...pls
Public Class AddOutPatient
Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncancel.Click
Me.DialogResult = Windows.Forms.DialogResult.Cancel
End Sub
Private Sub btnaddout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaddout.Click
'validation for firstname
If txtfirst.Text.Trim = "" Then
MsgBox("You should enter your firstname", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
txtfirst.Focus()
Exit Sub
End If
If txtfirst.Text.Contains(".") Then
MsgBox("The name should include letters only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
txtfirst.Focus()
Exit Sub
End If
'validation for lastname
If txtlast.Text.Trim = "" Then
MsgBox("You should enter your lastname", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
txtlast.Focus()
Exit Sub
End If
If txtlast.Text.Contains(".") Then
MsgBox("The name should include letters only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
txtlast.Focus()
Exit Sub
End If
'validation for age
If txtage.Text.Contains("-") Then
MsgBox("The age should only include digits only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
txtage.Focus()
Exit Sub
End If
If Not IsNumeric(txtage.Text) Then
MsgBox("The age should only include digits only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
txtage.Focus()
Exit Sub
End If
'validation for sex
If txtsex.Text.Trim = "" Then
MsgBox("You should enter your sex", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
txtlast.Focus()
Exit Sub
End If
If txtsex.Text.Contains(".") Then
MsgBox("The name should include letters only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
txtlast.Focus()
Exit Sub
End If
'insert patient
Try
Dim TA As New DB1DataSet1TableAdapters.OutPatient_infoTableAdapter
TA.Insert(txtfirst.Text)
'close window and return ok
Me.DialogResult = Windows.Forms.DialogResult.OK
Catch ex As Exception
'display error message
MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly)
End Try
End Sub
End Class