i am extreamly stuck from morning can someone help me i have a sql data adaptor which is not returning any values . In the same page in the top i have a SQldataadaptor which works fine . I do not know what to do . The query is working fine in the Server. I am using vs10 and sqlserver 2008 ..
I have also tried by removing the parameters it is still not working '. Always my rowcount is zero
here is my code
doc = dr["DrName"].ToString();
sql1 = "select w.Day, w.Start,[End] from WeeklyScheduleDays w where w.Start is not null and w.Day = @day1 and WeeklyScheduleID = (select WeeklyScheduleID from DoctorsBusinessHours db inner join drmast m on m.DoctorId = db.DcotorID where m.DrName = '@drname2') order by Start ";
SqlCommand m1 = new SqlCommand(sql1,myConnection);
m1.Parameters.AddWithValue("@day1", i);
m1.Parameters.AddWithValue("@drname2", doc);
SqlDataAdapter ad = new SqlDataAdapter(m1);
DataTable t1 = new DataTable();
ad.Fill(t1);
rowcount = t1.Rows.Count;
Thanks in advance