|
楼主 |
发表于 2020-6-4 23:15:01
|
显示全部楼层
我先用了:Dim binds As BindingSource = New BindingSource
Dim dt As DataTable = New DataTable
Dim da As Odbc.OdbcDataAdapter
Dim Conn As New Odbc.OdbcConnection
Conn = Me.comm.DBopen()
da = New Odbc.OdbcDataAdapter(sSelectCmd, Conn)
da.Fill(dt)
binds.DataSource = dt
Me.DgViewReportCode.DataSource = binds
Me.BindingNavReportCode.BindingSource = bind
然后在另外一个过程用了
Dim dt1 As DataTable = New DataTable()
dt1 = Me.DgViewReportCode.DataSource '''这里报错
IsPaste = False
dt1.AcceptChanges()
报错为:"无法将System.Windows.Forms.BindingSource类型转换为System.Data.DataTable类型"
为什么会报这样的错啊......该怎样改了/??? |
|