已解决,代码如下:
DataSet ds;
OleDbConnection objConnection;
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=d:/test.mdb";
objConnection = new OleDbConnection(strConnection);
ds = new DataSet();
objConnection.Open();
sda=new OleDbDataAdapter("select max(ysrq) as ysrq from book where tsbh='" + tsbh.Text + "' and ysc='" + ysc.Text + "'", objConnection);
sda.Fill(ds, "book");
DateTime old = Convert.ToDateTime( ds.Tables["book"].Rows[0]["ysrq"]);
DateTime now = Convert.ToDateTime(jtrq.Text);
TimeSpan span = now.Subtract(old);
int days = span.Days;