Function getcorntittle() As System.Data.IDataReader
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; data source="+server.MapPath("data/date.mdb")
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = "SELECT [corn].[corn_tittle],[corn].[corn_id] FROM [corn]"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
dbConnection.Open
Dim dataReader As System.Data.IDataReader = dbCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
Return dataReader
End Function' Insert page code here
dim SelectedTeam as String
Sub Page_Load()
corntittlelist.DataSource =getcorntittle()
corntittlelist.DataBind()
End Sub
种植关键技术
智能决策
专家论坛
在线答疑