title: The error is Conversion from string "" to type 'Double' is not valid
body: <pre><code>Private Sub btntambah_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btntambah.Click
      Dim n As Integer
      For n = 0 To lv1.Items.Count - 1
          If lv1.Items(n).Text = txtkdbrng.Text Then
              MsgBox("Data Buku Sudah Ada Dalam List")
              Exit Sub
          End If
      Next
      lv1.Items.Add(txtkdbrng.Text)
      lv1.Items(n).SubItems.Add(txtnmbrng.Text)
      lv1.Items(n).SubItems.Add(txtharga.Text)
      lv1.Items(n).SubItems.Add(txtjmlhhrg.Text)
      lv1.Items(n).SubItems.Add(txttotal.Text)
      lv1.Items(n).SubItems.Add(txtjmlpsn.Text)
      lv1.Items(n).SubItems.Add(txtspesifikasi.Text)
      txttotal.Text = Format(CDbl(Total()), "###, ###, ###")
      ClearBarang()
      txtkdbrng.Focus()
  End Sub
  
  Function Total() As Double
      Dim ttl As Double = 0
      If Not Double.TryParse(txttotal.Text, Total) Then
          Total = 0
      End If
  End Function
  
  Private Sub btncetak_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btncetak.Click
      If txtnosph.Text = "" Or lv1.Items.Count = 0 Then
          MsgBox("Data Belum Lengkap", MsgBoxStyle.Information, "INFORMASI")
      Else
          Dim nilaikembali1, nilaikembali2 As Integer
          objsph.PNoSph = txtnosph.Text
          objsph.PTglSph = Format(dtpsph.Value, "yyy-MM-dd")
          objsph.PKdCs = txtkdcstmr.Text
          nilaikembali1 = objsph.Simpan()
          'menyimpan ke tabel Ada menggunakan perulangan
          For x As Integer = 0 To lv1.Items.Count - 1
              objada.PNoSph = txtnosph.Text
              objada.PKdBrg = lv1.Items(x).SubItems(1).Text
              objada.PKdBrg = CDbl(lv1.Items(x).SubItems(2).Text)
              objada.PKdBrg = CDbl(lv1.Items(x).SubItems(3).Text)
              nilaikembali2 = objada.Simpan()
              Dim objbarang As New ClsBarang
              objbarang.PKdBrg = lv1.Items(x).SubItems(0).Text
          Next
          If nilaikembali1 = 1 And nilaikembali2 = 1 Then
              MsgBox("Data Berhasil Disimpan", MsgBoxStyle.Information, "INFORMASI")
          End If
          ClearForm()
          ClearBarang()
          ClearCustomer()
          txtnosph.Text = objsph.AutoNumber
      End If
  End Sub
  </code></pre>