Use the DataGrid in the .NET Framework component to display the record of the Recordset object in the ADO.

xiaoxiao2021-03-06  51

Although the DataGrid control in the COM component can be used in the VB.NET to display the record of the Recordset object in the ADO, but the functionality of the DataGrid control in the COM component is far from the DataGrid control in the .NET Framework component, which can also be used. The DataGrid control in the NET Framework component displays the record of the Recordset object in the ADO. See that most people see that most people use the DataGrid control in the .NET Framework component to display the record of the Datsset object in ADO.NET.

Then, what is the record of the Recordset object in the ADO for use in the DataGrid in the .NET Framework component?

Imports ADODB Imports System.Data Imports System.Data.OleDb Private Sub frmMain_Load (ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim rs_YPDZT As New ADODB.Recordset Dim sql As String sql = "select * from YPFLG_DZT "Rs_ypdzt.cursorlocation = cursorlocationenum.aduseclient rs_ypdzt.open (SQL, CONN, CURSORTYPEENUM.AdopenKeyset, LockTypeenum.adlockPESSIMISTIC)

Dim ds_YPDZT As New Data.DataSet Dim da_YPDZT As OleDbDataAdapter da_YPDZT = New OleDbDataAdapter (sql, gLinkString) da_YPDZT.Fill (ds_YPDZT, rs_YPDZT, "YPB") StatusBar1.Panels.Item (0) .Text = username DataGrid1.DataSource = ds_YPDZT. Tables ("YPB") End Sub.NET Framework Components DataGrid Displays records of the Recordset object in the ADO, must match the Recordset to the DataSet, such as the statement: Da_YPDZT.FILL (DS_YPDZT, RS_YPDZT, "YPB")!

转载请注明原文地址:https://www.9cbs.com/read-87914.html

New Post(0)