1
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim data As DataRow
Try
OleDbDataAdapter1.Fill(Me.DataSet11.PAYMENT)
data = DataSet11.PAYMENT.Rows.Find(txtpayment.Text)
txtpayment.Text = data("CustomerIC")
txtName.Text = data("CustomerName")
txtadd.Text = data("CustomerAddress")
txttel.Text = data("NoTel")
If cKurung.AutoCheck = True Then
cKurung.Checked = data("Baju Kurung")
Quan1 = Convert.ToInt32(txtQ1.Text)
Quan1 = data("Quantity1")
End If
If cKebaya.AutoCheck = True Then
cKebaya.Checked = data("Baju Kebaya")
Quan2 = Convert.ToInt32(txtQ2.Text)
Quan2 = data("Quantity2")
End If
If cTudung.AutoCheck = True Then
cTudung.Checked = data("Tudung")
Quan3 = Convert.ToInt32(txtQ3.Text)
Quan3 = data("Quantity3")
End If
If cSelendang.AutoCheck = True Then
cSelendang.Checked = data("Selendang")
Quan4 = Convert.ToInt32(txtQ4.Text)
Quan4 = data("Quantity4")
End If
If cTelekung.AutoCheck = True Then
cTelekung.Checked = data("Telekung")
Quan5 = Convert.ToInt32(txtQ5.Text)
Quan5 = data("Quantity5")
End If
If cAnakTudung.AutoCheck = True Then
cAnakTudung.Checked = data("Anak Tudung")
Quan6 = Convert.ToInt32(txtQ6.Text)
Quan6 = data("Quantity6")
End If
txtQuan.Text = data("Quantity")
txtPrice.Text = data("Price")
Catch ex As Exception
MessageBox.Show("Invalid Customer IC", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtpayment.Text = ""
txtpayment.Focus()
txtpayment.ReadOnly = False
End Try
End Sub
獲取數據這是我的代碼。調用數量而不是Quantity1它會拋出錯誤。例如,在其他形式中,我僅填充數量1,但其他數量我不填充,然後當我想查找數據時,它將會出錯。異常從數據庫
**錯誤是什麼_say _?**您是否閱讀過? – SLaks
** txtQ1.AutoCompleteCustomSource = data(「Quantity1」)**部分發生錯誤? – matzone
@SLaks會這樣說:「輸入字符串格式不正確。」 – user2387931