I try this SQL query and this query show results'
- select distinct
- tblvv.MID,
- tblrv.ownername,
- from tblvv
- join tblrv on tblrv.ID=tblvv.MID
- join tblre on tblre.RID = tblrv.RID
- WHERE tblre.Region ='UK' and
- StartDate = '2014-02-01 00:00:00.000' AND
- EndDate = '2014-02-28 23:59:59.000'
- order by
- tblrv.ownername
- try
- {
- DateTime frmdate = Convert.ToDateTime(fromdate.Value.Trim().Split('T')[0]);
- DateTime tdatee = Convert.ToDateTime(todate.Value.Trim().Split('T')[0]);
- string regionvalue = regiondrop.SelectedValue;
- T1 ts = new Ts1();
- var dq = (from vv in ts.tblvv
- join rv in ts.tblrv on vv.MID equals rv.ID
- join re in ts.tblre on rv.RID equals re.RID
- where
- re.Region == regionvalue
- && re.StartDate == frmdate
- && re.EndDate == tdatee
- orderby rv.OwnerName
- select new
- {
- ownername = rv.OwnerName,
- MID= vv.MID,
- }).ToList();
- GridView1.DataSource = dq;
- GridView1.DataBind();
- }
- catch (Exception)
- {
- GridView1.Visible = false;
- Label4.Text = ("No Data");
- }
but this above query not show any result
when i write || this sign on this line
- && re.StartDate == frmdate
like
- || re.StartDate == frmdate
then query shows so many records and this records are totally different from records which is in SQL query
also when i set break point there is not any error occurred
any solution?
Vinay SinghPosted Jun 27, 2016, 4:51 AM
Vinay SinghPosted Jun 27, 2016, 5:18 AM
scropio gurlPosted Jun 27, 2016, 5:08 AM
scropio gurlPosted Jun 27, 2016, 5:05 AM
@Vinay Singh
scropio gurlPosted Jun 27, 2016, 4:29 AM
Asad AliPosted Jun 27, 2016, 4:26 AM