C#怎么从SQL数据库通过时间和指定内容查询数据
如题啊如题啊
//这个是指定时间查找的
if ((pn_textBox.Text == "") && (sn_textBox.Text == "") && (startdate_dateTimePicker.Text != "") && (enddate_dateTimePicker.Text != ""))
{
command = command1;
}
//这个是指定sn内容查询
if ((sn_textBox.Text != "") && (pn_textBox.Text == ""))
{
command = command2;
}
//这个是指定pn内容查询--------------------------但是这个查询就是不受时间控制会把所有PN内容相同的查出来,现在的问题就是我想查询我指定日期的这个PN内容的数据
if ((sn_textBox.Text == "") && (pn_textBox.Text != ""))
{
command = command3;
}
listView1.Items.Clear();