2012-02-23 82 views
-2

adp3 =新的SqlDataAdapter(「SELECT patients.p_name,doctor.doc_name,appointmentments.ap_date FROM patients INNER JOIN appointment ON ON patients。 p_id = appointmentments.p_id INNER doctor ON appointments..doc_id = doctor.doc_id WHERE(CONVERT(char(8),appointmentments.ap_date,112)> = CONVERT(char(8),GETDATE(),112))和doctor.doc_id =「+ did,con) adp3.fill(ds3)從字符串「SELECT patients.p_name,doctor.do」轉換爲輸入「Double」無效

+0

問題是什麼?你能至少嘗試格式化你的代碼嗎? – svick 2012-02-24 01:18:11

回答

0

當您將字符串添加到double時,它會嘗試將字符串轉換爲double。

使用&操作迫使雙convesion爲一個字符串,或者使用ToString方法來顯式轉換雙:

adp3 = New SqlDataAdapter("..." & did, con) 

或:

adp3 = New SqlDataAdapter("..." + did.ToString(), con) 
相關問題