I have an application in which I had to change the selection of a day be a range of days instead. The query when ran in Management Studio works and returns the correct results. However in the application nothing is returned.
Code:
SqlCommand com = new SqlCommand();
com.Connection = Program.ConnnectDatabase();
com.CommandText = Resources.FillProcessing;
string strDay = string.Empty;
if (cboProcessDay.Text.ToString().Trim() == "Monday")
strDay = "'Monday'";
com.Parameters.Add(new SqlParameter("@Day", strDay));
DataTable dt = new DataTable();
SqlDataAdapter adt = new SqlDataAdapter();
adt.SelectCommand = com;
adt.Fill(dt);
SQL:
SELECT data.*
FROM Rec_data data, acc_info info
WHERE Day IN (@Day)
AND info.foracid = data.foracid
Any idea what i am doing wrong?