hi all I am trying to create a report which show me sold products between two dates
this is what I have done
but it is giving me this error
- A data source instance has not been supplied for the data source 'ShowSelling'.
this is my code
{
DataSet thisDataSet = new DataSet();
SqlConnection thisConnection = new SqlConnection(thisConnectionString);
SqlDataAdapter dataAdapter = new System.Data.SqlClient.SqlDataAdapter();
System.Data.SqlClient.
SqlCommand select = new System.Data.SqlClient.SqlCommand();
select.CommandType = CommandType.StoredProcedure;
select.Connection = thisConnection;
select.CommandText = "ShowSelling";
select.Parameters.Add(
"@SDate", SqlDbType.DateTime).Value =Convert.ToDateTime( TextBox1.Text);
select.Parameters.AddWithValue(
"@EDate", SqlDbType.DateTime).Value = Convert.ToDateTime(TextBox2.Text);
dataAdapter.SelectCommand = select;
dataAdapter.Fill(thisDataSet);
ReportDataSource datasource = new
ReportDataSource("ShowSellingDataSet_ShowSelling", thisDataSet.Tables[0]);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(datasource);
if (thisDataSet.Tables[0].Rows.Count == 0)
{
Label1.Text = "Sorry, no products under this category!";
}
ReportViewer1.LocalReport.Refresh();
}
and this is the procedure
/////////////////////////////////////////////////////////////////////////////////////////////////
ALTER PROCEDURE ShowSelling(@SDate DateTime , @EDate DateTime )
AS
SELECT neworder.Date, Software.SName,
Software.Price, neworder.quantity
FROM neworder INNER JOIN
Software ON neworder.softID = Software.softID
WHERE neworder.Date between @SDate and @EDate
RETURN
///////////////////////////////////////////////////////////////////////////////////////////
please help !!!!