1个回答
展开全部
爱莫能助,我们都是用C#和vb.net来做的
追问
vb中如何做?
追答
Imports System.Data.OleDb
Public Class check
Private Sub 查询学生成绩ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 查询学生成绩ToolStripMenuItem.Click
Dim constr As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Administrator\桌面\新建文件夹\考试系统\考试系统\bin\Debug\db1.mdb;Persist Security Info=False"
Dim conn As OleDb.OleDbConnection = New OleDb.OleDbConnection(constr)
conn.Open()
Dim sqlstr As String = "SELECT * FROM stu"
Dim mydataadapter As New OleDb.OleDbDataAdapter
Dim mydataset As New DataSet
mydataadapter.SelectCommand = New OleDb.OleDbCommand(sqlstr, conn)
mydataadapter.Fill(mydataset, "table1")
DataGridView1.DataSource = mydataset.Tables("table1")
mydataset.Dispose()
mydataadapter.Dispose()
conn.Close()
conn.Dispose()
End Sub你参照下吧,我们的期末做的考试系统,连接成绩表的。改下目录和表名,VB.net的代码。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询