Datagrid列上的数据加载(1) [英] Data Load on Datagrid Columns(1)
本文介绍了Datagrid列上的数据加载(1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果DataGridView Columns(4)="batch_no";然后在DatagridView Columns(1)上加载数据.我写了一些不起作用的代码.我已经从DataGridView上的另一个表加载了数据.如何编写此代码:
If DataGridView Columns(4) = "batch_no" then Data Load on DatagridView Columns(1). I write some code it's not function. I've already data load from another table on DataGridView. How to write this code :
Public Sub Batch_Load()
For i = 0 To DGV.Rows.Count-1
Cons()
Str = "Select batch_no from tbl_mstock where batch_no= '" & DGV.Item(4, i).Value & "'"
Cmd = New MySqlCommand(Str, Con)
Dr = Cmd.ExecuteReader
While Dr.Read = True
Batchs = Dr(0)
End While
connection_close()
Next
DGV.Item(1, i).Value = Batchs
End Sub
Private Sub DGV_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles DGV.CellEndEdit
If e.ColumnIndex = 7 Then
Batch_Load()
End If
End Sub
请帮助我的问题........
Please help my problem........
dopenoinam
dopenoinam
推荐答案
请更具体地说明不起作用的地方.
Please be more specific to what is not working.
这篇关于Datagrid列上的数据加载(1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文