Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27184

VS 2010 Help with Shopping cart system program

$
0
0
i have it all coded but im getting a error with these lines
it says Conversion from string "" to type 'Double' is not valid.

Private Sub btnAddBookToCart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddBookToCart.Click
Dim objMainForm As New MainForm

If lbPrintBooks.SelectedIndex <> -1 Then

MainForm.lbBooks.Items.Add(lbPrintBooks.SelectedItem.ToString())

this line error gives me Conversion from string "" to type 'Double' is not valid.
MainForm.lblSubtotal.Text = (CDbl(MainForm.lblSubtotal.Text) + objMainForm.BookCost(lbPrintBooks.SelectedIndex)).ToString()
MainForm.lblTax.Text = ((CDbl(MainForm.lblSubtotal.Text)) * 6 / 100).ToString()
MainForm.lblShipping.Text = ((MainForm.lbBooks.Items.Count) * 2).ToString()
MainForm.lblTotal.Text = (CDbl(MainForm.lblSubtotal.Text) + CDbl(MainForm.lblTax.Text) + CDbl(MainForm.lblShipping.Text)).ToString()

End If

End Sub

Viewing all articles
Browse latest Browse all 27184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>