0
所以我有2個MySQL表,一個名爲「Service_Details」和一個叫「Payment_details」填充與MySQL數據的文本框的組合框選擇後
我在形式的組合框從顯示「service_id爲」場服務表。 我想編碼一個文本框,所以當我從組合框中選擇服務ID時,它會寫入「服務」,這是服務詳細信息表中的另一個字段。服務ID鏈接到服務。
我得到的錯誤「標識應爲」在[0]和system.data.datatablecollection在dss.tables‘不能轉換爲‘字符串’「的類型值’
我似乎無法得到它瀏覽互聯網一小時
這裏工作後,是我的代碼:
Private Sub cbxserviceid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxserviceid.SelectedIndexChanged
Dim dss As New DataSet
Dim daa As New MySqlDataAdapter("SELECT * from service_details WHERE ServiceID='" + cbxserviceid.Text + "'", objconnection)
Dim cmddd = New MySqlCommandBuilder(daa)
daa.Fill(dss)
txtService1.Text = dss.Tables[0].Rows[0]["Service"].ToString();
End Sub
我得到命令執行過程中遇到錯誤致命錯誤。 'daa.fill(dss)'? ? – Livaren
Steve有什麼想法? – Livaren
對不起,我沒有注意到你的第一個評論。字段ServiceID是MySql中的字符串(文本)還是整數? – Steve