请帮助我,因为我在网上找不到任何解决方案,我试图做一些 THREAD 函数来从一毫秒访问数据库(.mdb)中选择查询。另一个词..针对相同的 ms 访问数据库 (.mdb) 的线程函数...它总是失败。这是代码:
private void Form1_Load(object sender, EventArgs e)
{
Thread th1 = new Thread(new ThreadStart(method1));
Thread th2 = new Thread(new ThreadStart(method2));
th1.Start();
th2.start();
}
private void method1()
{
using (OleDbConnection odbConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbfileName + ";Mode=Read"))
{
//db manipulation1
}
}
private void method2()
{
using (OleDbConnection odbConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbfileName + ";Mode=Read"))
{
//db manipulation2
}
}