 |
|
Cannot bind to the property or column SerialNo on the DataSource.
Parameter name: dataMember
Code (VB.NET)
If dr.HasRows Then
ClearBinding()
dtTotalPrint.Load(dr)
bs.DataSource = dtTotalPrint
bn.BindingSource = bs
dgvPrintList.DataSource = dtTotalPrint
ShowPosition()
txtEmployeeID.DataBindings.Add("Text", bs, "EmployeeID")
txtFullName.DataBindings.Add("Text", bs, "FullName")
txtDepartment.DataBindings.Add("Text", bs, "DepID")
With cboNamePrint
.DisplayMember = "ModelName"
.ValueMember = "SerialNo"
.DataBindings.Add("SelectedValue", bs, "SerialNo")
.DataSource = dtDetialPrinter
End With
เป็นการค้นหาข้อมูล ซึ่ง ถ้าทำการ Comment Code ด้านล่างนี้ ก็จะแสดงได้ปกติครับ
Code (VB.NET)
With cboNamePrint
.DisplayMember = "ModelName"
.ValueMember = "SerialNo"
.DataBindings.Add("SelectedValue", bs, "SerialNo")
.DataSource = dtDetialPrinter
End With
ปล. Code ก็ Copy มาอีก Form ซึ่งใช้งานได้ปกติเหมือนกันได้ส่วน ค้นหา Combobox แต่ส่วนนี้ Error ซะงั้น
Tag : .NET, Ms SQL Server 2008, VBScript
|
ประวัติการแก้ไข 2013-08-07 11:56:02 2013-08-07 11:56:02
|
 |
 |
 |
 |
Date :
2013-08-07 11:55:10 |
By :
ih4cK |
View :
1373 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |