C# 用文本框输入的时间段查询SQL数据库

文本框TextBox1和TextBox2 内分别输入时间

用这个时间段来查询数据库

以下两种字符串都能用来查询数据库:

1、string sqlcom = "select * from 表名 where  时间 between '" + TextBox1.Text + "' and '" + TextBox2.Text + "' ";

2、string sqlcom = "select * from 表名 where  时间 >= '" + TextBox1.Text + "' and 时间<='" + TextBox2.Text + "' ";

原文地址:https://www.cnblogs.com/zssblog/p/5392551.html