datagridview加载数据库慢的问题
datagridview加载access数据库,里面只有2000条记录,显示特别慢,有办法解决吗?谢谢!Public constr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\殷会计\户籍2\bin\main.mdb"
Public mycon As OleDbConnection = New OleDbConnection(constr)
Try
mycon.Open()
Catch ex As Exception
MsgBox("数据库打开错误!")
End
End Try
Dim xs As String = "select " & xianshi & " from mingxi order by 按户编号"
mydb1 = New OleDbDataAdapter(xs, mycon)
mydb1.Fill(mydc1, "mingxi")
'DataGridView1.RowHeadersWidth = 4
DataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToFirstHeader
DataGridView1.DataSource = mydc1.Tables("mingxi")