![](/img/trans.png)
[英]How do I write the SQL to retrieve records for a single date from Access database using C#
[英]How to retrieve desired date from access database using C#
我正在使用C#处理Access数据库,希望使用SQL语句根据所需日期选择所有信息。 例如今天。
"SELECT * from mytable where mytable.dates == DateTime.Today()";
如果我理解正确的问题,并且想要调用SQL Server,则可以使用SQLCommand
和参数。
var sqlCommand = new SqlCommand();
sqlCommand.CommandText = "SELECT * from mytable where mytable.dates= @DateAdded";
sqlCommand.Parameters.AddWithValue("@DateAdded", DateTime.Today);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.