数据库语句 求助帖
有一年多没写了..反复测试没个结果...请各位高人 帮忙看看 哪里错了..
OleDbDataAdapter myDa1 = new OleDbDataAdapter("select * from fenye where bugtime BETWEEN '#2011-08-01 00:00:00#' and '#2011-08-30 00:00:00#' ", conn);
// OleDbDataAdapter myDa1 = new OleDbDataAdapter("select * from fenye where bugtime >= '" + Date1.Text + "' and bugtime <= '" + Date2.Text + "' ", conn);
DataSet myDs1 = new DataSet();
myDa1.Fill(myDs1, "fenye");
GridView1.DataSource = myDs1.Tables["fenye"].DefaultView;
GridView1.DataBind();
GridView1.PageIndex = 0;
错误在 :("select * from fenye where bugtime BETWEEN '#2011-08-01 00:00:00#' and '#2011-08-30 00:00:00#'里
("select * from fenye where bugtime >= '" + Date1.Text + "' and bugtime <= '" + Date2.Text + "'
查询两个时间范围 是怎么样写的?我这里 写的地方那里错了。。数据没有读出来...
请高人们 指点下...