G
Guest
hello
Can anyone help me with a problem i have
I have made an array to hold values. I am adding values to this array when the user clicks an 'Add' butto
If Not ((CBoxMealName.Text = "") Or (txtMealQty.Text = "")) The
Dim ChosenMeal As Strin
ChosenMeal = CBoxMealName.Text.ToStrin
Dim Quantity As Intege
Quantity = txtMealQty.Tex
MyMealTypeArray(ArrayIndex) = ChosenMea
MyMealQtyArray(ArrayIndex) = Quantit
ArrayIndex = (ArrayIndex + 1
Els
MsgBox("Please ensure all the required fields are entered correctly"
End I
When the user selects the submit button, i want these values pushed to a Meal Booking datatable
Here is the submit button code
Dim InsRoomBooking As DataRo
Dim MealInsRow As DataRo
If Not ((CBoxRoomNames.Text = "") Or (CBoxLayout.Text = "") Or (txtNoOfGuests.Text
= "") Or (CBoxSession.Text = "")) The
Dim RoomIDB4Substr As String = CBoxRoomNames.Tex
Dim RoomID As String = RoomIDB4Substr.Substring(0, 3
'PUSH THE DATA INTO MY ROOM BOOKING DATATABL
InsRoomBooking = dsFullBooking.Tables("dtRoomBooking").NewRow(
InsRoomBooking("BookingNo") = "-1
InsRoomBooking("RoomID") = RoomI
InsRoomBooking("RoomDt") = dtpRoomDate.Value.ToShortDateStrin
InsRoomBooking("Room_Name") = CBoxRoomNames.Tex
InsRoomBooking("Req_Session") = CBoxSession.Tex
InsRoomBooking("Req_Layout") = CBoxLayout.Tex
InsRoomBooking("No_Of_Guests") = txtNoOfGuests.Tex
InsRoomBooking("Room_Cost") = lblRoomCharge.Tex
dsFullBooking.Tables("dtRoomBooking").Rows.Add(InsRoomBooking
'----------------------------------------------------------------------
'PUSH THE MEAL BOOKING DATA FROM MY ARRAY INTO THE MEAL BOOKING DATATABL
For ArrayIndex = 0 To (ArrayIndex - 1
MealInsRow = dsFullBooking.Tables("dtMealBooking").NewRow(
MealInsRow("BookingNo") = "-1
MealInsRow("RoomID") = RoomI
MealInsRow("RoomDt") = dtpRoomDate.Tex
MealInsRow("Req_Session") = CBoxSession.Tex
MealInsRow("Meal_Type") = MyMealTypeArray(ArrayIndex
MealInsRow("Meal_Qty") = MyMealQtyArray(ArrayIndex
dsFullBooking.Tables("dtMealBooking").Rows.Add(MealInsRow
Next ArrayInde
Else : MsgBox("Please ensure all the required fields are entered correctly"
End I
The problem is that my Meal booking datatable does not get popualted with the values from my array. My RoomBooking Datatable works fine however!!
When i take the array code out of the IF statement, it works fine!!
Is there something i am missing here!!?
Any help would be appreciated.
Can anyone help me with a problem i have
I have made an array to hold values. I am adding values to this array when the user clicks an 'Add' butto
If Not ((CBoxMealName.Text = "") Or (txtMealQty.Text = "")) The
Dim ChosenMeal As Strin
ChosenMeal = CBoxMealName.Text.ToStrin
Dim Quantity As Intege
Quantity = txtMealQty.Tex
MyMealTypeArray(ArrayIndex) = ChosenMea
MyMealQtyArray(ArrayIndex) = Quantit
ArrayIndex = (ArrayIndex + 1
Els
MsgBox("Please ensure all the required fields are entered correctly"
End I
When the user selects the submit button, i want these values pushed to a Meal Booking datatable
Here is the submit button code
Dim InsRoomBooking As DataRo
Dim MealInsRow As DataRo
If Not ((CBoxRoomNames.Text = "") Or (CBoxLayout.Text = "") Or (txtNoOfGuests.Text
= "") Or (CBoxSession.Text = "")) The
Dim RoomIDB4Substr As String = CBoxRoomNames.Tex
Dim RoomID As String = RoomIDB4Substr.Substring(0, 3
'PUSH THE DATA INTO MY ROOM BOOKING DATATABL
InsRoomBooking = dsFullBooking.Tables("dtRoomBooking").NewRow(
InsRoomBooking("BookingNo") = "-1
InsRoomBooking("RoomID") = RoomI
InsRoomBooking("RoomDt") = dtpRoomDate.Value.ToShortDateStrin
InsRoomBooking("Room_Name") = CBoxRoomNames.Tex
InsRoomBooking("Req_Session") = CBoxSession.Tex
InsRoomBooking("Req_Layout") = CBoxLayout.Tex
InsRoomBooking("No_Of_Guests") = txtNoOfGuests.Tex
InsRoomBooking("Room_Cost") = lblRoomCharge.Tex
dsFullBooking.Tables("dtRoomBooking").Rows.Add(InsRoomBooking
'----------------------------------------------------------------------
'PUSH THE MEAL BOOKING DATA FROM MY ARRAY INTO THE MEAL BOOKING DATATABL
For ArrayIndex = 0 To (ArrayIndex - 1
MealInsRow = dsFullBooking.Tables("dtMealBooking").NewRow(
MealInsRow("BookingNo") = "-1
MealInsRow("RoomID") = RoomI
MealInsRow("RoomDt") = dtpRoomDate.Tex
MealInsRow("Req_Session") = CBoxSession.Tex
MealInsRow("Meal_Type") = MyMealTypeArray(ArrayIndex
MealInsRow("Meal_Qty") = MyMealQtyArray(ArrayIndex
dsFullBooking.Tables("dtMealBooking").Rows.Add(MealInsRow
Next ArrayInde
Else : MsgBox("Please ensure all the required fields are entered correctly"
End I
The problem is that my Meal booking datatable does not get popualted with the values from my array. My RoomBooking Datatable works fine however!!
When i take the array code out of the IF statement, it works fine!!
Is there something i am missing here!!?
Any help would be appreciated.