if语句里面的不能执行,帮忙看看代码
protected void Button1_Click(object sender, EventArgs e)
{
string conn = ConfigurationSettings.AppSettings[ "strconn "];
SqlConnection st = new SqlConnection(conn);
string strSelect;
string strSelect2;
string strSelect3;
SqlCommand cmdSelect;
SqlCommand cmdSelect2;
SqlCommand cmdSelect3;
strSelect = "select [customerno],[goodsno],[goodsnumber] from[stock] where (([customerno]= "+customer.Text + ") AND ( [goodsno]= ' "+product.Text+ " ')) ";
strSelect2= "select [customerno],[goodsno],[goodsnumber] from[stock] where (([customerno]= "+customer.Text + ")) ";
strSelect3= "select [customerno],[goodsno],[goodsnumber] from[stock] where (([goodsno]= ' "+product.Text+ " ')) ";
cmdSelect = new SqlCommand(strSelect ,st );
cmdSelect2 = new SqlCommand(strSelect2,st);
cmdSelect3 = new SqlCommand(strSelect3, st);
st.Open();
DataSet ds = new DataSet();
if (customer.Text == " ")
{
if (product.Text == " ")
{
Response.Write( " <script language=javascript> alert( '查詢條件不能為空 ') </script> ");
}
else
{
cmdSelect3.ExecuteNonQuery();
SqlDataAdapter da1 = new SqlDataAdapter(strSelect3, st);
da1.Fill(ds);