 |
|
รบกวนพี่ๆช่วยดูให้หน่อยค่ะ ขึ้น No value given for one or more required parameters. |
|
 |
|
|
 |
 |
|
Code (VB.NET)
Private Sub frmListAllProducts_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Windows.Forms.Cursor.Current = Cursors.WaitCursor
With Conn
If .State = ConnectionState.Open Then .Close()
.ConnectionString = strConn
.Open()
End With
Dim sqlProduct As String = ""
sqlProduct = "SELECT t_Product.Product_id, t_Product.Product_name, t_Product.Product_Brand,"
sqlProduct &= " t_Product.Product_Detail, t_Product.Product_Price, t_Product.Product_Total"
sqlProduct &= " FROM t_Product"
If IsFind = True Then
ds.Tables("t_Product").Clear()
End If
da = New OleDbDataAdapter(sqlProduct, Conn)
da.SelectCommand.CommandText = sqlProduct
da.Fill(ds, "t_Product") Error ตรงนี้นะค่ะลอแก้มาหลายวิธีแล้วค่ะ
If ds.Tables("t_Product").Rows.Count <> 0 Then
IsFind = True
With grdProducts
.AllowNavigation = False
.ReadOnly = True
.DataSource = ds.Tables("t_Product")
End With
Else
IsFind = False
grdProducts.DataSource = Nothing
End If
FormatDataGridWithData()
Windows.Forms.Cursor.Current = Cursors.Default
End Sub
Tag : .NET, Ms Access, MySQL, VB.NET
|
|
 |
 |
 |
 |
Date :
2012-03-16 21:30:27 |
By :
Bow |
View :
1003 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Query คุณผิดน่ะครับ ลองใช่้
Code (VB.NET)
Dim sqlProduct As String = ""
sqlProduct = "SELECT * FROM t_Product "
|
 |
 |
 |
 |
Date :
2012-03-16 21:49:59 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
Dim sqlProduct As String = ""
sqlProduct = "SELECT * FROM t_Products "
sqlProduct = "SELECT t_Products.Product_id, t_Products.Product_name, t_Products.Product_Brand,"
sqlProduct &= " t_Products.Product_Detail, t_Products.Product_Price, t_Products.Product_Total"
sqlProduct &= " FROM t_Products"
If IsFind = True Then
ds.Tables("t_Products").Clear()
End If
da = New OleDbDataAdapter(sqlProduct, Conn)
da.SelectCommand.CommandText = sqlProduct
da.Fill(ds, "t_Products")
If ds.Tables("t_Products").Rows.Count <> 0 Then
IsFind = True
ยังขึ้นเหมือนเดิมเลยค่ะ
|
 |
 |
 |
 |
Date :
2012-03-16 22:25:56 |
By :
Bow |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
sqlProduct เอาแถวแรกแถวเดียวเลยครับ
|
 |
 |
 |
 |
Date :
2012-03-17 15:01:29 |
By :
kosin_man |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
sqlProduct = "SELECT * FROM t_Products " <====== 1
sqlProduct = "SELECT t_Products.Product_id, t_Products.Product_name, t_Products.Product_Brand," <====2
sqlProduct &= " t_Products.Product_Detail, t_Products.Product_Price, t_Products.Product_Total"
sqlProduct &= " FROM t_Products"
ทำไมคิวรี่ 2 รอบเลยหล่ะครับ ใช้ อันที่ 1 อันเดียวครับ
ส่วนอันที่ 2 ดูแล้วก็ไม่ผิดนะครับ ลองตรวจดู Field ที่ต้องการ คิวรี่ กับ Field ในตารางอีกครั้งนะครับว่าตรงกันหรือไม่
|
 |
 |
 |
 |
Date :
2012-03-17 15:22:19 |
By :
ผ่านมาดูครับ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|