Hello,
I've query when I run it in the sql server it gives me the correct result ,but I put in my code the result changed?
This is my query
This is my code
The result in sql like this:
Product_id dat 101 2012-11-1 102 2012-11-1
In C# like this:
product_id dat 100 2012-10-10 101 2012-11-1 102 2012-11-1
I've query when I run it in the sql server it gives me the correct result ,but I put in my code the result changed?
This is my query
Code:
String data = "SELECT [dat] ,[product_id] FROM [market].[dbo].[product] where dat>='2012-11-1' and dat='2012-11-1'
Code:
SqlConnection con=new SqlConnection (@"Data Source=.\Ahmed;Initial Catalog=Market;Integrated Security=True");
String data = "SELECT [dat] ,[product_id]FROM [market].[dbo].[product] where dat>='2012-11-1' and dat<='2012-11-31'";
con.Open();
SqlDataAdapter ad1 = new SqlDataAdapter(data, con);
DataSet ds1 = new DataSet();
ad1.Fill(ds1);
ReportDocument cr = new ReportDocument();
cr.Load(@"C:\Users\Ahmed\Documents\Visual Studio 2010\Projects\WindowsFormsApplication9\WindowsFormsApplication9\CrystalReport4.rpt");
cr.SetDataSource(ds1.Tables["product"]);
crystalReportViewer1.ReportSource = cr;
Product_id dat 101 2012-11-1 102 2012-11-1
In C# like this:
product_id dat 100 2012-10-10 101 2012-11-1 102 2012-11-1