展开全部
string connectionStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=Test.mdb;Persist Security Info=false;Jet OLEDB:Database Password=";
string s = string.Empty;
using (OleDbConnection con = new OleDbConnection(connectionStr))
{
con.Open();
using (OleDbCommand cmd = new OleDbCommand())
{
cmd.Connection = con;
cmd.CommandText = string.Format("select * from YouTableName where ID between {0} and {1} ",10.ToString(),20.ToString());
DataTable dt = new DataTable();
dt.Load(cmd.ExecuteReader());
}
}
追问
大神能不能给这些代码给个注释。。求求你了。我没连过库,看不懂
追答
都一目了然了,还用什麼注释哦
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询