|
 |
|
ช่วยดูให้หน่อยครับ (Incorrect syntax near ',', ผมเพิ่งหัดเขียนโปรแกรมครับ รบกวนผู้รู้ทุกท่าน ช่วยผมแก้ปัญหาหน่อยครับ จนปัญญาจริงๆ |
|
 |
|
|
 |
 |
|
tempsql2 = "select MaterialDetail.PriceList_id , MaterialDetail.Material_id , Material.Material_name , MaterialDetail.Material_price ,"
tempsql2 &= "MaterialDetail.Component_id , Component.Component_name , MaterialDetail.Component_price ,"
tempsql2 &= "MaterialDetail.Installation_id , Installation.Installation_name ,MaterialDetail.Installation_price ,"
tempsql2 &= "MaterialDetail.Width_material ,MaterialDetail.Long_material ,"
tempsql2 &= "MaterialDetail.Total_price, MaterialDetail.Material_Amount"
tempsql2 &= "from MaterialDetail, Material, Component, Installation"
tempsql2 &= "where MaterialDetail.Material_id = Material.Material_id"
tempsql2 &= "and MaterialDetail.Component_id = Component.Component_id"
tempsql2 &= "and MaterialDetail.Installation_id = Installation.Installation_id"
tempsql2 &= "and PriceList_id ='" & txtplsid.Text & ")"
da2 = New SqlDataAdapter(tempsql2, SqlConnection1)
da2.Fill(ds2, "MatDetail") <--------- (Incorrect syntax near ',', )
*** ผมเพิ่งหัดเขียนโปรแกรมครับ รบกวนผู้รู้ทุกท่าน ช่วยผมแก้ปัญหาหน่อยครับ จนปัญญาจริงๆ ***
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2010-02-20 00:17:47 |
By :
fakestar |
View :
1323 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เติม space หลัง เปิดเครื่องหมายคำพูด และก่อนปิดเครื่องหมายคำพูด
จะทำให้ชีวิตวัยเรียนสดใสขึ้นเยอะค่ะ ^^
Code (VB.NET)
tempsql2 = " select MaterialDetail.PriceList_id , MaterialDetail.Material_id ,Material.Material_name , MaterialDetail.Material_price , "
tempsql2 &= " MaterialDetail.Component_id , Component.Component_name , MaterialDetail.Component_price ,"
tempsql2 &= " MaterialDetail.Installation_id , Installation.Installation_name ,MaterialDetail.Installation_price , "
tempsql2 &= " MaterialDetail.Width_material ,MaterialDetail.Long_material , "
tempsql2 &= " MaterialDetail.Total_price, MaterialDetail.Material_Amount "
tempsql2 &= " from MaterialDetail, Material, Component, Installation "
tempsql2 &= " where ( MaterialDetail.Material_id = Material.Material_id ) "
tempsql2 &= " and ( MaterialDetail.Component_id = Component.Component_id ) "
tempsql2 &= " and ( MaterialDetail.Installation_id = Installation.Installation_id ) "
tempsql2 &= " and ( PriceList_id ='" & txtplsid.Text & "' ) " ' << ลืม Apostrophe ไปอันนึงค่ะ
da2 = New SqlDataAdapter(tempsql2, SqlConnection1)
da2.Fill(ds2, "MatDetail")
เวลาเอา Code ลง ให้ใช้ BB-Code จะ VB หรือ C#
ครอบสักนิดนึงจะดีมากนะคะ เพราะจะมองหาสัญลักษ์ ' " ที่ผิดปกติได้ง่ายค่ะ
|
 |
 |
 |
 |
Date :
2010-02-20 00:34:10 |
By :
blurEye |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันยังไม่หายเลยครับ ยังขึ้นเหมือนเดิมเลยครับ
|
 |
 |
 |
 |
Date :
2010-02-20 00:57:36 |
By :
fakestar |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ ขอขอบคุณ คุณ Gee มาก ๆ เลยครับ
|
 |
 |
 |
 |
Date :
2010-02-20 01:05:54 |
By :
fakestar |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Syntax น่าจะถูกหมดแล้ว ตรวจสอบชื่อฟิลด์ ชื่อ table อีกครั้งค่ะ
Code (C#)
tempsql2 = " SELECT MaterialDetail.PriceList_id, MaterialDetail.Material_id, "
tempsql2 &= " Material.Material_name , MaterialDetail.Material_price , "
tempsql2 &= " MaterialDetail.Component_id, Component.Component_name, MaterialDetail.Component_price ,"
tempsql2 &= " MaterialDetail.Installation_id, Installation.Installation_name, "
tempsql2 &= " MaterialDetail.Installation_price , "
tempsql2 &= " MaterialDetail.Width_material, MaterialDetail.Long_material, "
tempsql2 &= " MaterialDetail.Total_price, MaterialDetail.Material_Amount "
tempsql2 &= " FROM MaterialDetail, Material, Component, Installation "
tempsql2 &= " WHERE ( MaterialDetail.Material_id = Material.Material_id ) "
tempsql2 &= " AND ( MaterialDetail.Component_id = Component.Component_id ) "
tempsql2 &= " AND ( MaterialDetail.Installation_id = Installation.Installation_id ) "
tempsql2 &= " AND ( PriceList_id ='" & txtplsid.Text & "' ) " ' << ลืม Apostrophe ไปอันนึงค่ะ
da2 = New SqlDataAdapter(tempsql2, SqlConnection1)
da2.Fill(ds2, "MatDetail")
|
 |
 |
 |
 |
Date :
2010-02-20 01:07:59 |
By :
blurEye |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|