文本框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 + "' ";