STUDY

xiaoxiao2021-03-06  53

Imports System.DataImports System.Data.OleDbpublic Class Webform1 Inherits System.Web.ui.page

#Region "The code" of the web form designer "

'This call is required for the web form designer. private subinitializecomponent ()

End sub protected withevents data data as system.Web.ui.WebControls.DataGrid

'Note: The following placeholders declare are required by the web form designer. 'Don't delete or move it. Private DesignerPlaceHolderDeclaration as System.Object

Private Sub Page_init (Byval E AS System.EventArgs) Handles mybase.init 'Codegen: This method call is required by the Web Form Designer' Do not modify it using the code editor. InitializationComponent () End Sub

#End region

Dim MYCONNECTION As OleDbConnection Dim MYDATAADAPTER As OleDbDataAdapter Dim MYDATASET As DataSet = New DataSet Private Sub Page_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MYCONNECTION = New OleDbConnection ( "Provider = Microsoft.Jet.OLEDB .4.0; Data Source = C: /TEST.mdb ") 'Dim mYCOMMAND As New OleDbCommand (" SELECT * FROM test ", mYCONNECTION) MYDATAADAPTER = New OleDbDataAdapter (" SELECT * FROM test ", mYCONNECTION) MYDATAADAPTER.Fill (mYDATASET, "Test") DataGrid1.datasource = mydataset.tables ("test"). DefaultView DataGrid1.database () MyConnection.Close () End Subend Class

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

New Post(0)