My code is getting the following error
System.InvalidCastException was unhandled
Message="Conversion from string "" to type 'Integer' is not valid."
My code is the following
Private Sub btnMyQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMyQuery.Click
Dim daPrice As RMDHDataSet.Ticket_PriceDataTable
Dim quant As Integer
Dim price As Double
Dim i As Integer
Dim price_id As Integer
quant = txtQuantity.Text
daPrice = Ticket_PriceTableAdapter.GetDataBy(quant)
price = Double.Parse(daPrice.Rows(0).Item("Ticket_Price"))
price_id = Integer.Parse(daPrice.Rows(0).Item("Ticket_Price_ID"))
txtcost_per_ticket.Text = price
txtTotal_cost.Text = price * quant
For i = 1 To quant
TicketsTableAdapter.InsertQuery(CInt(txtSalesGiftType.Text), CStr(price_id), txtSalesTicketStatus.Text, txtSalesDonorID.Text)
Next
End Sub
Private Sub chkgift_type_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkgift_type.CheckedChanged
If chkgift_type.Checked = True Then
txtSalesGiftType.Text = "yes"
Else : txtSalesGiftType.Text = "no"
End If
End Sub
I'm not understanding what is going on? Ugh any help would be great thank you in advance.
System.InvalidCastException was unhandled
Message="Conversion from string "" to type 'Integer' is not valid."
My code is the following
Private Sub btnMyQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMyQuery.Click
Dim daPrice As RMDHDataSet.Ticket_PriceDataTable
Dim quant As Integer
Dim price As Double
Dim i As Integer
Dim price_id As Integer
quant = txtQuantity.Text
daPrice = Ticket_PriceTableAdapter.GetDataBy(quant)
price = Double.Parse(daPrice.Rows(0).Item("Ticket_Price"))
price_id = Integer.Parse(daPrice.Rows(0).Item("Ticket_Price_ID"))
txtcost_per_ticket.Text = price
txtTotal_cost.Text = price * quant
For i = 1 To quant
TicketsTableAdapter.InsertQuery(CInt(txtSalesGiftType.Text), CStr(price_id), txtSalesTicketStatus.Text, txtSalesDonorID.Text)
Next
End Sub
Private Sub chkgift_type_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkgift_type.CheckedChanged
If chkgift_type.Checked = True Then
txtSalesGiftType.Text = "yes"
Else : txtSalesGiftType.Text = "no"
End If
End Sub
I'm not understanding what is going on? Ugh any help would be great thank you in advance.