c#问题:关键字 'where' 附近有语法错误。请帮帮忙,无限感激

private void button1_Click(object sender, EventArgs e)
{
conn = new SqlConnection(str);
if (textBox1.Text == "" && dateTimePicker1.Text == "")
str1 = "select *from 卫生检查信息表";
else
{
if (textBox1.Text != "")
str1 = str1 + " where 宿舍号='" + textBox1.Text + "'";
if (dateTimePicker1.Text != "")
str1 = str1 + "where 检查日期='" + dateTimePicker1.Text + "'";
}
da = new SqlDataAdapter(str1, conn);
DataSet ds = new DataSet();
ds.Clear();
da.Fill(ds, "卫生检查信息表");
dataGridView1.DataSource = ds.Tables["卫生检查信息表"].DefaultView;
str1 = "select * from 卫生检查信息表";
conn.Close();
}

str1 = str1 + " where 宿舍号='" + textBox1.Text + "'";
where 前面加空格
温馨提示:答案为网友推荐,仅供参考