executing stored procs

M

myt

I' m trying to call a stored proc in vb.net.I get this exception
Oracle.DataAccess.Client.OracleException ORA-06550:
line 1, column 7:pLS-00306: wrong number or types of arguments
in call to 'SPSETPERSONIDENTIFIER1'ORA-06550: line 1,
column 7:pL/SQL: Statement ignored
at dhss.vitals.web.data.VitalsBirth.Component
184 at VitalsBirth.Record1.bSave_Click(Object sender, EventArgs e) in
C:\sandbox\MOEVR\Source\VitalsBirth\App\Record1.aspx.vb:line 217

I have also noticed that this procedure works fine if there were two
buttons on this page one for each table insertion.I get this problem
when I combine the code for inserting into two different tables ie
call two different methods for inserting in a single button event.
I have also pasted my code
Partial Public Class Record1
Inherits System.Web.UI.Page
Dim oDataComponent As New
dhss.vitals.web.data.VitalsBirth.Component_Mythili
Dim PPersonId As New
dhss.vitals.web.data.VitalsBirth.PropertyPerson.PersonIdentifier
Dim PName1 As New
dhss.vitals.web.data.VitalsBirth.PropertyPersonName.PersonName
Dim VRecord As New
dhss.vitals.web.data.VitalsBirth.PropertyVitalRecord.VitalRecord
Dim VitalsLoginUser As New dhss.vitals.web.classes.VitalsLoginUser
Dim VitalsLoginUser1 As New
dhss.vitals.web.classes.VitalsLoginUser



Protected Sub ddlPlurality_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ddlPlurality.SelectedIndexChanged
If ddlPlurality.SelectedItem.Text = "Decaplet (10)" And
txtOrder.Text <> "10" Then
lblPlurality.Text = "Verify Plurality"
End If
If ddlPlurality.SelectedItem.Text = "(11)" And txtOrder.Text
<> "11" Then
lblPlurality.Text = "Verify Plurality"
End If
If ddlPlurality.SelectedItem.Text = "(12)" And txtOrder.Text
<> "12" Then
lblPlurality.Text = "Verify Plurality"
End If
If ddlPlurality.SelectedItem.Text = "Unknown" And
txtOrder.Text <> "99" Then
lblPlurality.Text = "Verify Plurality"
End If




End Sub

Protected Sub chkUnknownCheck_CheckedChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
chkUnknownCheck.CheckedChanged
If chkUnknownCheck.Checked Then
txtMotherMedical.Text = ""
End If
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
'elw.LogError("in RecordIdentification.aspx")
If Not IsPostBack Then

lnkMotherMedical.Visible = False
lnkDobDelivery.Visible = False
lnkTOB.Visible = False
lnkSex.Visible = False
lnkPlurality.Visible = False
End If

End Sub

Protected Sub txtOrder_TextChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles txtOrder.TextChanged
If (txtOrder.Text <> "") Then
If IsNumeric(txtOrder.Text) Then
If (Trim((txtOrder.Text).Length = 2)) Then
If (txtOrder.Text <= 12) Then
Else
lblPlurality.Text = "Order delivered in the
pregnancy must be 2 digits 01-12 or 99 or blank if not applicable"
End If
Else
lblPlurality.Text = "Order's delivered in the
pregnancy must be 2 digits 01-12 or 99 or blank if not applicable"
End If
Else
lblPlurality.Text = "Order's delivered in the
pregnancy must be 2 digits 01-12 or 99 or blank if not applicable"
End If
Else
lblPlurality.Text = ""
End If
If (txtOrder.Text = "0") Then
lblPlurality.Text = "verify Plurality"
End If

End Sub

Protected Sub bSave_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles bSave.Click
If (ddlPlurality.SelectedItem.Value = "01" Or
ddlPlurality.SelectedItem.Value = "Blank as the default" Or
ddlPlurality.SelectedItem.Value = "unknown") And (txtOrder.Text < 1 Or
txtOrder.Text > 12) Then
lblPlurality.Text = "Plurality must be 2-12 to accept an
Order delivered in the pregnancy of 01-12"
ElseIf ddlPlurality.SelectedItem.Value = "02" And
(txtOrder.Text < 1 Or txtOrder.Text > 2) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response."

ElseIf ddlPlurality.SelectedItem.Value = "03" And
(txtOrder.Text <= 1 Or txtOrder.Text > 3) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response."

ElseIf ddlPlurality.SelectedItem.Value = "04" And
(txtOrder.Text <= 1 Or txtOrder.Text > 4) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response."
ElseIf ddlPlurality.SelectedItem.Value = "05" And
(txtOrder.Text <= 1 Or txtOrder.Text > 5) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response. "
ElseIf ddlPlurality.SelectedItem.Value = "06" And
(txtOrder.Text <= 1 Or txtOrder.Text > 5) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response."
ElseIf ddlPlurality.SelectedItem.Value = "07" And
(txtOrder.Text <= 1 Or txtOrder.Text > 7) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response. "
ElseIf ddlPlurality.SelectedItem.Value = "08" And
(txtOrder.Text <= 1 Or txtOrder.Text > 8) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response."
ElseIf ddlPlurality.SelectedItem.Value = "09" And
(txtOrder.Text <= 1 Or txtOrder.Text > 9) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response. "
ElseIf ddlPlurality.SelectedItem.Value = "10" And
(txtOrder.Text <= 1 Or txtOrder.Text > 10) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response."
ElseIf ddlPlurality.SelectedItem.Value = "11" And
(txtOrder.Text <= 1 Or txtOrder.Text > 11) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response. "
ElseIf ddlPlurality.SelectedItem.Value = "12" And
(txtOrder.Text <= 1 Or txtOrder.Text > 12) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response. "
ElseIf ddlPlurality.SelectedItem.Value = "01" And
(txtOrder.Text < 1 Or txtOrder.Text > 1) Then
lblPlurality.Text = "Please review the Plurality and Order
delivered in the pregnancy and enter the correct response. "
Else
lblPlurality.Text = ""
End If


If txtMotherMedical.Text = "" And chkUnknownCheck.Checked =
False Then
lnkMotherMedical.Text = "Verify Record number"
lnkMotherMedical.Visible = True
End If
If txtMomDOBMonth.Text = "" Or txtMomDOBDay.Text = "" Or
txtMomDOBYear.Text = "" Then
lnkDobDelivery.Text = "Enter Date of birth"
lnkDobDelivery.Visible = True
End If
If txtDeliveryHour.Text = "" Or txtDeliveryMinute.Text = "" Or
(chkPm.Checked = False And chkAm.Checked = False And
chkMilitary.Checked = False) Then
lnkTOB.Text = "Enter Time"
lnkTOB.Visible = True
End If
If (chkMale.Checked = False And chkFemale.Checked = False And
chkUndetermined.Checked = False) Then
lnkSex.Text = "Enter Sex"
lnkSex.Visible = True
End If
If (ddlPlurality.SelectedItem.Value = " " Or txtOrder.Text =
"0") Then
lnkPlurality.Text = "verify Plurality"
lnkPlurality.Visible = True
End If
If (UCase(txtMotherMedical.Text) = "UNKNOWN" Or
LCase(txtMotherMedical.Text) = "unknown") Then
lblMotherMedical.Text = "Either enter a medical record
number or check Unknown"
End If
If txtChildMedical.Text = "" And chkUnknown1.Checked = False
Then
lnkChildMedical.Text = "Verify Record number"
lnkChildMedical.Visible = True
End If
If (UCase(txtChildMedical.Text) = "UNKNOWN" Or
LCase(txtChildMedical.Text) = "unknown") Then
lblChildMedical.Text = "Either enter a medical record
number or check Unknown"
End If
'Insert the Mom's /Babies info into identifier table
Dim Flag As Integer
Dim MORF, Medical1 As String
Dim DD, MM, YY As Integer
MORF = "U"
Medical1 = "99ab"
If chkMale.Checked = True Then
MORF = "M"
End If
If chkFemale.Checked = True Then
MORF = "F"
End If

If txtMotherMedical.Text <> "" Then
Medical1 = txtMotherMedical.Text
MORF = "F"
End If
If txtChildMedical.Text <> "" Then
Medical1 = txtChildMedical.Text
End If
'Take in the babies DOB
If txtMomDOBMonth.Text <> "" Then
DD = Convert.ToInt32(txtMomDOBDay.Text)
MM = Convert.ToInt32(txtMomDOBMonth.Text)
YY = Convert.ToInt32(txtMomDOBYear.Text)
End If
'Take in Babies DOB
If txtDOBMM.Text <> "" Then
DD = Convert.ToInt32(txtDOBDD.Text)
MM = Convert.ToInt32(txtDOBMM.Text)
YY = Convert.ToInt32(txtDOBYY.Text)
End If
'Dim Flag1 As Integer
'Dim fname, lname, mname, Suffix1 As String
'fname = ""
'lname = ""
'mname = ""
'Suffix1 = ""

'If txtMomFirst.Text <> "" Then
' fname = txtMomFirst.Text
' lname = txtMomLast.Text
' mname = txtMomMiddle.Text
' If (ddlMomSuffix.SelectedItem.Value = "") Then
' Suffix1 = "N/A"
' Else
' Suffix1 = ddlMomSuffix.SelectedItem.Value
' End If
'End If
'If txtChildFirst.Text <> "" Then
' fname = txtChildFirst.Text
' lname = txtChildLast.Text
' mname = txtChildMiddle.Text
' If (ddlChildSuffix.SelectedItem.Value = "") Then
' Suffix1 = "N/A"
' Else
' Suffix1 = ddlChildSuffix.SelectedItem.Value
' End If
'End If
'Insert record for either mom's or babies
Try
VitalsLoginUser =
Session(VitalsLoginUser.VITALS_LOGIN_USER_SESSION_KEY)
Inserting name

'PName1.FirstName = fname
'PName1.LastName = lname
'PName1.MiddleName = mname
'PName1.Suffix = Suffix1
'Flag1 =
oDataComponent.setSecurityDataPersonName(VitalsLoginUser, PName1)
'Second(Table) inserting other details
'VitalsLoginUser1 =
Session(VitalsLoginUser.VITALS_LOGIN_USER_SESSION_KEY)
PPersonId.MedicalRecordNumber = Medical1
PPersonId.dateBirthDD = DD
PPersonId.dateBirthMM = MM
PPersonId.dateBirthYY = YY
PPersonId.timeBirthHour =
Convert.ToInt32(txtDeliveryHour.Text)
PPersonId.timeBirthMinute =
Convert.ToInt32(txtDeliveryMinute.Text)
PPersonId.PluralitySetOrder =
Convert.ToInt32(txtOrder.Text)
'PPersonId.personIdentificationNumber =
Convert.ToInt32(TextBox8.Text)
PPersonId.Plurality = ddlPlurality.SelectedItem.Value
PPersonId.Sex = MORF
Flag = oDataComponent.setSecurityData(VitalsLoginUser,
PPersonId)
'If Flag1 = 0 Then
' Response.Write("oops! that was an invalid record")
'Else
' Response.Write("The record is inserted")

'End If
If Flag = 0 Then
Response.Write("The record is inserted")
Else
Response.Write("oops! that was an invalid record")
End If
Catch ex As Exception
Me.txtError.Text = ex.ToString
Response.Write(ex)
End Try











End Sub
Private Sub Search_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Search.Click
Dim identity, Vid As Integer

identity = Convert.ToInt32(txtIdentifierId.Text)
Vid = Convert.ToInt32(txtVitalRecordId.Text)
Try
VitalsLoginUser =
Session(VitalsLoginUser.VITALS_LOGIN_USER_SESSION_KEY)
PPersonId =
oDataComponent.getSecurityData(VitalsLoginUser, identity, Vid)
If PPersonId.Ind = 1 Then
'mom's medical record number in mom's textt box
txtMotherMedical.Text = PPersonId.MedicalRecordNumber
Else
'Babies medical record in babies text box
txtChildMedical.Text = PPersonId.MedicalRecordNumber
End If
If PPersonId.Ind = 1 Then
' load mom's details in mom's Text boxes
txtDOBDD.Text = PPersonId.dateBirthDD
txtDOBMM.Text = PPersonId.dateBirthMM
txtDOBYY.Text = PPersonId.dateBirthYY
txtDeliveryHour.Text = PPersonId.timeBirthHour
txtDeliveryMinute.Text = PPersonId.timeBirthMinute
txtOrder.Text = PPersonId.PluralitySetOrder
ddlPlurality.SelectedItem.Value = PPersonId.Plurality

If PPersonId.Sex = "F" Then
chkFemale.Checked = True
End If

Else
'Show babies details in babies text boxes
txtMomDOBDay.Text = PPersonId.dateBirthDD
txtMomDOBMonth.Text = PPersonId.dateBirthMM
txtMomDOBYear.Text = PPersonId.dateBirthYY
txtDeliveryHour.Text = PPersonId.timeBirthHour
txtDeliveryMinute.Text = PPersonId.timeBirthMinute
txtOrder.Text = PPersonId.PluralitySetOrder
ddlPlurality.SelectedItem.Value = PPersonId.Plurality
If PPersonId.Sex = "M" Then
chkMale.Checked = True
End If
If PPersonId.Sex = "F" Then
chkFemale.Checked = True
End If
If PPersonId.Sex = "U" Then
chkUndetermined.Checked = True
End If
End If
Dim time As Integer
time = PPersonId.timeBirthHour
If time > 1 And time < 11 Then
chkAm.Checked = True
End If
If time > 11 And time <= 12 Then
chkAm.Checked = False
chkPm.Checked = True
End If
If time > 12 And time >= 23 Then
chkMilitary.Checked = True
End If

Catch ex As Exception
Me.txtError.Text = ex.ToString
Response.Write(ex)
End Try
End Sub

Protected Sub chkMale_CheckedChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles chkMale.CheckedChanged
If IsPostBack Then


If chkMale.Checked = True Then
chkFemale.Enabled = False
chkUndetermined.Enabled = False
End If
If chkMale.Checked = False Then
chkFemale.Enabled = True
chkUndetermined.Enabled = True
End If
End If
End Sub

Protected Sub chkFemale_CheckedChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles chkFemale.CheckedChanged
If IsPostBack Then


If chkFemale.Checked = True Then
chkMale.Enabled = False
chkUndetermined.Enabled = False
End If
If chkFemale.Checked = False Then
chkMale.Enabled = True
chkUndetermined.Enabled = True
End If
End If
End Sub

Protected Sub chkUndetermined_CheckedChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
chkUndetermined.CheckedChanged
If IsPostBack Then
If chkUndetermined.Checked = True Then
chkMale.Enabled = False
chkFemale.Enabled = False
End If
If chkUndetermined.Checked = False Then
chkFemale.Enabled = True
chkMale.Enabled = True

End If
End If
End Sub

Protected Sub txtDeliveryHour_TextChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles txtDeliveryHour.TextChanged
If IsNumeric(txtDeliveryHour.Text) Then


'if none of the check boxes are selected and time is
entered
If chkAm.Checked = False And chkPm.Checked = False And
chkMilitary.Checked = False Then
If (txtDeliveryHour.Text <> "") Then
lblTOBDelivery.Text = "Hour must be 2 digits 01-23
or 99"
txtDeliveryHour.Focus()
Else
lblTOBDelivery.Text = ""
End If
End If
'Check for digits am and 24 hour time

If (txtDeliveryHour.Text <> "") Then
If IsNumeric(txtDeliveryHour.Text) Then
If (Trim((txtDeliveryHour.Text).Length = 2)) Then
Else
lblTOBDelivery.Text = "a.m. hour must be 2
digits 00-11 or 99"
txtDeliveryHour.Focus()
End If

If (txtDeliveryHour.Text < 0 Or
txtDeliveryHour.Text <= 59 Or txtDeliveryHour.Text = 99) Then
Else
lblTOBDelivery.Text = "Minutes must be 2
digits 00-59 or 99"
txtDeliveryHour.Focus()
End If
Else
lblTOBDelivery.Text = "Minutes must be 2 digits
00-59 or 99"
End If

'check for am and 11 hour time
If (chkAm.Checked = True) Then

If ((txtDeliveryHour.Text < 0 Or
txtDeliveryHour.Text > 11) And txtDeliveryHour.Text <> 99) Then
lblTOBDelivery.Text = "a.m. hour must be 2
digits 00-11 or 99"
End If
Else
lblTOBDelivery.Text = ""
End If
'check for pm and 12 hour time
If (chkPm.Checked = True) Then

If ((txtDeliveryHour.Text < 0 Or
txtDeliveryHour.Text > 12) And txtDeliveryHour.Text <> 99) Then
lblTOBDelivery.Text = "p.m. hour must be 2
digits 00-12 or 99"
txtDeliveryHour.Focus()
End If

End If
'Check for military and 24 hour time
If (chkMilitary.Checked = True) Then
If ((txtDeliveryHour.Text < 0 Or
txtDeliveryHour.Text > 23) And txtDeliveryHour.Text <> 99) Then
lblTOBDelivery.Text = "military hour must be 2
digits 00-23 or 99"
txtDeliveryHour.Focus()
End If

End If
If txtDeliveryHour.Text = 0 Or txtDeliveryHour.Text =
12 Then

MsgBox("Verify 00:00 a.m. is midnight, 12:00 p.m.
is noon", MsgBoxStyle.OkCancel)
End If
If txtDeliveryHour.Text = "99" And
txtDeliveryMinute.Text <> "99" Then
MsgBox("If hour is 99 then Minute should also be
99")
End If
If txtDeliveryMinute.Text = "99" And
txtDeliveryHour.Text <> "99" Then
MsgBox("If hour is 99 then Minute should also be
99")
End If
Else
lblTOBDelivery.Text = ""
End If
If (Trim((txtDeliveryHour.Text).Length = 2)) Then
txtDeliveryMinute.Focus()
End If
Else
lblTOBDelivery.Text = "Hour must be 2 digits 01-23 or 99"
End If

End Sub

Protected Sub txtDeliveryMinute_TextChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
txtDeliveryMinute.TextChanged


If (txtDeliveryMinute.Text <> "") Then
If IsNumeric(txtDeliveryMinute.Text) Then

If (Trim((txtDeliveryMinute.Text).Length = 2)) Then

If ((txtDeliveryMinute.Text < 0 Or
txtDeliveryMinute.Text >= 59) Or txtDeliveryMinute.Text <> 99) Then






If (Trim((txtDeliveryMinute.Text).Length = 2))
Then
chkAm.Focus()
End If


Else
lblTOBDelivery.Text = "Minutes must be 2
digits 00-59 or 99"

End If
Else
lblTOBDelivery.Text = "Minutes must be 2 digits
00-59 or 99"
End If
Else

lblTOBDelivery.Text = "Minutes must be 2 digits 00-59
or 99"
txtDeliveryMinute.Focus()
End If
Else
lblTOBDelivery.Text = "Minutes must be 2 digits 00-59 or
99"
txtDeliveryMinute.Focus()
End If

End Sub

Protected Sub txtMomDOBMonth_TextChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles txtMomDOBMonth.TextChanged
'check if non empty and numeric txtMomDOBMonth

If IsNumeric(txtMomDOBMonth.Text) Then
If (txtMomDOBMonth.Text <> "") Then
If (Trim((txtMomDOBMonth.Text).Length = 2)) Then
If (txtMomDOBMonth.Text <= 12) Then
Else
lblDOBDelivery.Text = "Month must be 2 digits
01-12 depending on the month"
End If
Else
lblDOBDelivery.Text = "Month's must be 2 digits
01-12 depending on the month"
End If

If (Trim((txtMomDOBMonth.Text).Length = 2)) Then
txtMomDOBDay.Focus()
End If
Else
lblDOBDelivery.Text = "Month's must be 2 digits 01-12
depending on the month"
End If
Else
lblDOBDelivery.Text = "Month's must be 2 digits 01-12
depending on the month"
End If


End Sub

Protected Sub txtMomDOBDay_TextChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles txtMomDOBDay.TextChanged
'check if non empty and numeric
If (txtMomDOBDay.Text <> "") Then
If IsNumeric(txtMomDOBDay.Text) Then
If (Trim((txtMomDOBDay.Text).Length = 2)) Then
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text >
31) Then
lblDOBDelivery.Text = "Day must be 2 digits
01-31 depending on the month"
End If
Else
lblDOBDelivery.Text = "Day must be 2 digits 01-31
depending on the month"
End If


If (Trim((txtMomDOBDay.Text).Length = 2)) Then
txtMomDOBYear.Focus()
End If
Else
lblDOBDelivery.Text = "Day must be 2 digits 01-31
depending on the month"
End If
Else
lblDOBDelivery.Text = "Day must be 2 digits 01-31
depending on the month"
End If
End Sub

Protected Sub txtMomDOBYear_TextChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles txtMomDOBYear.TextChanged
If (txtMomDOBYear.Text <> "") Then
If IsNumeric(txtMomDOBYear.Text) Then
If (Trim((txtMomDOBYear.Text).Length = 4)) Then
If (txtMomDOBYear.Text < 1000 Or
txtMomDOBYear.Text > 9999) Then

lblDOBDelivery.Text = "Year must be 4 digits"
Else
lblDOBDelivery.Text = ""
End If
Else
lblDOBDelivery.Text = "Year must be 4 digits"
End If



'check for month and days
Dim i As String
i = txtMomDOBMonth.Text
Dim year As Integer
year = txtMomDOBYear.Text
Dim leapyear As Boolean
If year Mod 4 = 0 Then
leapyear = True
If year Mod 100 = 0 Then
If (year Mod 400) Then
leapyear = False
End If

End If
End If

'Response.Write(year)
Dim daythis As Integer

Select Case i
Case "01"

'If leapyear Then
' daynext = 29
'Else
' daynext = 28
'End If
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month"
End If
Case "02"
If leapyear Then

If (txtMomDOBDay.Text < 1 Or
txtMomDOBDay.Text > 29) Then
lblDOBDelivery.Text = "February 29 is
invalid without a leap year "

End If
Else

If (txtMomDOBDay.Text < 1 Or
txtMomDOBDay.Text > 28) Then
lblDOBDelivery.Text = "February 29 is
invalid without a leap year "

End If

End If

Case "03"
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text

lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If

Case "04"

If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text

lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If

Case "05"
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If

Case "06"
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If


Case "07"
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If


Case "08"
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If

Case 9
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If

Case 10
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If

Case 11
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If

Case 12
If (txtMomDOBDay.Text < 1 Or txtMomDOBDay.Text
lblDOBDelivery.Text = "Day must be 2
digits 01-31 depending on the month "

End If

End Select
'same year > 30 days
Dim rem1, rem2, rem3 As Integer
Dim months = Convert.ToInt32(txtMomDOBMonth.Text)

Dim diffmonths As Integer
If txtMomDOBYear.Text < Now.Year Then
If Now.Month < months Then
diffmonths = months - Now.Month
If (diffmonths > 1) Then
lblDOBDelivery.Text = ("Verify > 30 days
old")
End If
End If
End If
If txtMomDOBYear.Text = Now.Year Then
If Now.Month > months Then
diffmonths = Now.Month - months
If (diffmonths > 1) Then
lblDOBDelivery.Text = ("Verify > 30 days
old")
End If
End If

If (diffmonths = 1) Then
Select Case months
Case "01"

rem1 = 30 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case "02"
If leapyear Then
daythis = 29
Else
daythis = 28
End If
rem1 = daythis -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case "03"
rem1 = 30 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case "04"
rem1 = 31 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case "05"
rem1 = 31 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case "06"
rem1 = 30 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case "07"
rem1 = 30 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case "08"
rem1 = 31 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2

Case "09"
rem1 = 30 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case 10
rem1 = 31 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case 11
rem1 = 30 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
Case 12
rem1 = 31 -
Convert.ToInt32(txtMomDOBDay.Text)
rem2 = Now.Day
rem3 = rem1 + rem2
End Select


End If

End If
Response.Write(rem3)

If rem3 >= 30 Then
lblDOBDelivery.Text = ("Verify > 30 days old")

End If

'If the date entered is future date
If txtMomDOBYear.Text > Now.Year Then
lblDOBDelivery.Text = ("Date cannot be future")
End If
If txtMomDOBYear.Text > Now.Year Then
If (txtMomDOBMonth.Text > Now.Month) Then
lblDOBDelivery.Text = ("Date cannot be
future")
End If
End If

If txtMomDOBYear.Text = Now.Year Then
If (txtMomDOBMonth.Text > Now.Month) Then
lblDOBDelivery.Text = ("Date cannot be
future")
Else
If (txtMomDOBMonth.Text = Now.Month) Then
If (txtMomDOBDay.Text > Now.Day) Then
lblDOBDelivery.Text = ("Date cannot be
future")
End If
End If
End If

End If
' If the age is > 12 years
Dim a, age As Integer
a = Convert.ToInt32(txtMomDOBYear.Text)
age = a + 12
'Response.Write("hello")
'Response.Write(age)

If Now.Year > age Then
lblDOB.Text = "Record cannot be entered via the
web for 12 years and older. Contact State Vital Records Office for
instructions."

End If
If age = Now.Year Then
If (txtMomDOBMonth.Text > Now.Month) Then
lblDOB.Text = "Record cannot be entered via
the web for 12 years and older. Contact State Vital Records Office
for instructions."

End If
If (txtMomDOBMonth.Text = Now.Month) Then
If (txtMomDOBDay.Text >= Now.Day) Then
lblDOB.Text = "Record cannot be entered
via the web for 12 years and older. Contact State Vital Records
Office for instructions."

End If
End If
End If
Else
lblDOBDelivery.Text = "Year must be 4 digits"
End If
Else
lblDOBDelivery.Text = "Year must be 4 digits"
End If
'If lblDOB.Text <> "" Then
' lblDOB.Text = ""
'End If
If (Trim((txtMomDOBYear.Text).Length = 4)) Then
txtDeliveryHour.Focus()
End If

End Sub

Private Sub lnkMotherMedical_Click(ByVal sender As Object, ByVal e
As System.EventArgs) Handles lnkMotherMedical.Click
txtMotherMedical.Focus()
End Sub

Protected Sub lnkDobDelivery_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lnkDobDelivery.Click
txtMomDOBMonth.Focus()
End Sub

Private Sub lnkTOB_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lnkTOB.Click
txtDeliveryHour.Focus()
End Sub

Private Sub lnkSex_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lnkSex.Click
chkFemale.Focus()
End Sub

Private Sub lnkPlurality_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lnkPlurality.Click
ddlPlurality.Focus()
End Sub

Protected Sub chkPm_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles chkPm.CheckedChanged
If chkPm.Checked = True Then
chkAm.Enabled = False
chkMilitary.Enabled = False
End If
If chkPm.Checked = False Then
chkAm.Enabled = True
chkMilitary.Enabled = True
End If
End Sub

Private Sub chkAm_CheckedChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles chkAm.CheckedChanged
If chkAm.Checked = True Then
chkPm.Enabled = False
chkMilitary.Enabled = False
End If
If chkAm.Checked = False Then
chkPm.Enabled = True
chkMilitary.Enabled = True
End If
End Sub

Private Sub chkMilitary_CheckedChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles chkMilitary.CheckedChanged
If chkMilitary.Checked = True Then
chkPm.Enabled = False
chkAm.Enabled = False
End If
If chkMilitary.Checked = False Then
chkPm.Enabled = True
chkAm.Enabled = True
End If
End Sub


Protected Sub chkUnknown1_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
chkUnknown1.CheckedChanged
If chkUnknown1.Checked = True Then
txtChildMedical.Text = ""
End If

End Sub

Protected Sub lnkChildMedical_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lnkChildMedical.Click
txtChildMedical.Focus()
End Sub

Protected Sub txtChildMedical_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
txtChildMedical.TextChanged

End Sub

Protected Sub txtDOBDD_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles txtDOBDD.TextChanged
'check if non empty and numeric
If (txtDOBDD.Text <> "") Then
If IsNumeric(txtDOBDD.Text) Then
If (Trim((txtDOBDD.Text).Length = 2)) Then
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 31) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month"
End If
Else
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month"
End If


If (Trim((txtDOBDD.Text).Length = 2)) Then
txtDOBDD.Focus()
End If
Else
lblDOBMom.Text = "Day must be 2 digits 01-31 depending
on the month"
End If
Else
lblDOBMom.Text = "Day must be 2 digits 01-31 depending on
the month"
End If
End Sub

Protected Sub txtDOBMM_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles txtDOBMM.TextChanged
'check if non empty and numeric txtMomDOBMonth

If IsNumeric(txtDOBMM.Text) Then
If (txtDOBMM.Text <> "") Then
If (Trim((txtDOBMM.Text).Length = 2)) Then
If (txtDOBMM.Text <= 12) Then
Else
lblDOBMom.Text = "Month must be 2 digits 01-31
depending on the month"
End If
Else
lblDOBMom.Text = "Month's must be 2 digits 01-12
depending on the month"
End If

If (Trim((txtDOBMM.Text).Length = 2)) Then
txtDOBDD.Focus()
End If
Else
lblDOBMom.Text = "Month's must be 2 digits 01-12
depending on the month"
End If
Else
lblDOBMom.Text = "Month's must be 2 digits 01-12 depending
on the month"
End If
End Sub

Protected Sub txtDOBYY_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles txtDOBYY.TextChanged
If (txtDOBYY.Text <> "") Then
If IsNumeric(txtDOBYY.Text) Then
If (Trim((txtDOBYY.Text).Length = 4)) Then
If (txtDOBYY.Text < 1000 Or txtDOBYY.Text > 9999)
Then

lblDOBMom.Text = "Year must be 4 digits"
Else
lblDOBMom.Text = ""
End If
Else
lblDOBMom.Text = "Year must be 4 digits"
End If
End If



'check for month and days
Dim i As String
i = txtDOBMM.Text
Dim year As Integer
year = txtDOBYY.Text
Dim leapyear As Boolean
If year Mod 4 = 0 Then
leapyear = True
If year Mod 100 = 0 Then
If (year Mod 400) Then
leapyear = False
End If

End If
End If



Select Case i
Case "01"

'If leapyear Then
' daynext = 29
'Else
' daynext = 28
'End If
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 30) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month"
End If
Case "02"
If leapyear Then

If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 29)
Then
lblDOBMom.Text = "February 29 is invalid
without a leap year "

End If
Else

If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 28)
Then
lblDOBMom.Text = "February 29 is invalid
without a leap year "

End If

End If

Case "03"
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 30) Then

lblDOBDelivery.Text = "Day must be 2 digits
01-31 depending on the month "

End If

Case "04"

If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 30) Then

lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If

Case "05"
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 31) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If

Case "06"
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 30) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If


Case "07"
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 31) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If


Case "08"
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 31) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If

Case 9
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 30) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If

Case 10
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 31) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If

Case 11
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 30) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If

Case 12
If (txtDOBDD.Text < 1 Or txtDOBDD.Text > 31) Then
lblDOBMom.Text = "Day must be 2 digits 01-31
depending on the month "

End If

End Select

If txtDOBYY.Text > Now.Year Then
MsgBox("Date cannot be future", MsgBoxStyle.OkCancel)
End If


If txtDOBYY.Text = Now.Year Then
If (txtDOBMM.Text > Now.Month) Then
lblDOBMom.Text = ("Date cannot be future")
Else
If (txtDOBMM.Text = Now.Month) Then
If (txtDOBDD.Text > Now.Day) Then
lblDOBMom.Text = ("Date cannot be future")
End If
End If
End If

End If

If (Trim((txtMomDOBYear.Text).Length = 4)) Then
lblDOBMom.Text = "Year must be 4 digits"
End If
txtDeliveryHour.Focus()
End If
End Sub

Private Sub Edit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Edit.Click
Dim Flag As Integer
Dim Medical1
' If the medical record is entered update mom's record
If PPersonId.Ind = 1 Then

Medical1 = PPersonId.MedicalRecordNumber
Else
' else babies
Medical1 = PPersonId.MedicalRecordNumber
End If
'If the baby's date of birth is entered then update babies
record
If PPersonId.Ind = 1 Then
PPersonId.personIdentificationNumber =
Convert.ToInt32(txtIdentifierId.Text)
PPersonId.dateBirthDD = Convert.ToInt32(txtMomDOBDay.Text)
PPersonId.dateBirthMM =
Convert.ToInt32(txtMomDOBMonth.Text)
PPersonId.dateBirthYY =
Convert.ToInt32(txtMomDOBYear.Text)
PPersonId.timeBirthHour =
Convert.ToInt32(txtDeliveryHour.Text)
PPersonId.timeBirthMinute =
Convert.ToInt32(txtDeliveryMinute.Text)
PPersonId.PluralitySetOrder =
Convert.ToInt32(txtOrder.Text)
PPersonId.Plurality =
Convert.ToInt32(ddlPlurality.SelectedItem.Value)
If PPersonId.Sex = "M" Then
chkMale.Checked = True
End If
If PPersonId.Sex = "F" Then
chkFemale.Checked = True
End If
If PPersonId.Sex = "U" Then
chkUndetermined.Checked = True
End If
''''''''''''''''''
' If mom's date of birth is entered then insert mom's
record
Else
PPersonId.personIdentificationNumber =
Convert.ToInt32(txtIdentifierId.Text)

PPersonId.dateBirthDD = Convert.ToInt32(txtDOBDD.Text)
PPersonId.dateBirthMM = Convert.ToInt32(txtDOBMM.Text)
PPersonId.dateBirthYY = Convert.ToInt32(txtDOBYY.Text)
PPersonId.timeBirthHour =
Convert.ToInt32(txtDeliveryHour.Text)
PPersonId.timeBirthMinute =
Convert.ToInt32(txtDeliveryMinute.Text)
PPersonId.PluralitySetOrder =
Convert.ToInt32(txtOrder.Text)
PPersonId.Plurality =
Convert.ToInt32(ddlPlurality.SelectedItem.Value)
If PPersonId.Sex = "M" Then
chkMale.Checked = True
End If
If PPersonId.Sex = "F" Then
chkFemale.Checked = True
End If
If PPersonId.Sex = "U" Then
chkUndetermined.Checked = True
End If
End If
Try
VitalsLoginUser =
Session(VitalsLoginUser.VITALS_LOGIN_USER_SESSION_KEY)



PPersonId.Plurality = ddlPlurality.SelectedItem.Value
Flag = oDataComponent.alterSecurityData(VitalsLoginUser,
PPersonId)

If Flag = 1 Then
Response.Write("The record is altered")
Else
Response.Write("oops! that was an invalid
recordnumber")
End If

Catch ex As Exception
Me.txtError.Text = ex.ToString
Response.Write(ex)
End Try
End Sub
*********************************************************
'Separate event it works fine

'Protected Sub InsertName_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles InsertName.Click
' Dim Flag1 As Integer
' Dim fname, lname, mname, Suffix1 As String
' fname = ""
' lname = ""
' mname = ""
' Suffix1 = ""

' If txtMomFirst.Text <> "" Then
' fname = txtMomFirst.Text
' lname = txtMomLast.Text
' mname = txtMomMiddle.Text
' If (ddlMomSuffix.SelectedItem.Value = "") Then
' Suffix1 = "N/A"
' Else
' Suffix1 = ddlMomSuffix.SelectedItem.Value
' End If
' End If
' If txtChildFirst.Text <> "" Then
' fname = txtChildFirst.Text
' lname = txtChildLast.Text
' mname = txtChildMiddle.Text
' If (ddlChildSuffix.SelectedItem.Value = "") Then
' Suffix1 = "N/A"
' Else
' Suffix1 = ddlChildSuffix.SelectedItem.Value
' End If
' End If
' Try
' VitalsLoginUser =
Session(VitalsLoginUser.VITALS_LOGIN_USER_SESSION_KEY)

' PName1.FirstName = fname
' PName1.LastName = lname
' PName1.MiddleName = mname
' PName1.Suffix = Suffix1
' Flag1 =
oDataComponent.setSecurityDataPersonName(VitalsLoginUser, PName1)
' Catch ex As Exception
' Me.txtError.Text = ex.ToString
' Response.Write(ex)
' End Try
'End Sub
End Class



Stored proc
***************************
CREATE OR REPLACE PROCEDURE spsetPersonIdentifier1 (
Recordnumber IN
Vitals.Identifier.MEDICAL_RECORD_NUMBER%Type,
DateBirthDD IN Vitals.Identifier.DATE_OF_BIRTH_DD
%TYPE,
DateBirthMM IN Vitals.Identifier.DATE_OF_BIRTH_MM%TYPE,
DateBirthYY IN Vitals.Identifier.DATE_OF_BIRTH_YY%TYPE,
TimeBirthHour IN Vitals.Identifier.TIME_OF_BIRTH_HOUR%Type,
TimeBirthMinute IN Vitals.Identifier.TIME_OF_BIRTH_MINUTE%Type,
PluralityOrder IN vitals.Identifier.PLURALITY_SET_ORDER%Type,
Plurality1 IN Vitals.Identifier.PLURALITY%Type,Sex1 IN
Vitals.Identifier.Sex%Type )
IS
Person_id_out Number(12);
BEGIN

/* get value for primary_key */
Person_id_out :=Pkg_Vitals_Utility.get_primary_key;


INSERT INTO
Vitals.Identifier(Identifier_id,MEDICAL_RECORD_NUMBER,DATE_OF_BIRTH_DD,DATE_OF_BIRTH_MM,DATE_OF_BIRTH_YY,TIME_OF_BIRTH_HOUR,TIME_OF_BIRTH_MINUTE,PLURALITY_SET_ORDER,PLURALITY,Sex)
VALUES
(Person_id_out,Recordnumber,DateBirthDD,DateBirthMM,DateBirthYY,TimeBirthHour,TimeBirthMinute,PluralityOrder,Plurality1,Sex1);
END spsetPersonIdentifier1;
/
 
M

Mr. Arnold

myt said:
I' m trying to call a stored proc in vb.net.I get this exception
Oracle.DataAccess.Client.OracleException ORA-06550:

<snipped>

And why you would post the code is a mystery. You need to debug it yourself.

Anyway, the message means exactly what it is saying. Either you're passing
too many, too few of a number of arguments or an argument being passed in
string when it should have been (int) to the stored (proc).

Sometimes you can set a brake point on the Catch and go to the InnerText
messages of the Exception and the messages might tell you exactly what is
wrong.
 
D

diAb0Lo

<snipped>

And why you would post the code is a mystery. You need to debug it yourself.

Anyway, the message means exactly what it is saying. Either you're passing
too many, too few of a number of arguments or an argument being passed in
string when it should have been (int) to the stored (proc).

Sometimes you can set a brake point on the Catch and go to the InnerText
messages of the Exception and the messages might tell you exactly what is
wrong.

Hi there,

Seeing the error, it says that you are sending more o less parameters
than it needs. Also, you could be sending to SP exactly the parameters
that it needs, but in wrong data type.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top