Methoun Ahmed

Methoun Ahmed

  • NA
  • 145
  • 102.3k

Failed to convert parameter value from a String to a DateTim

Aug 13 2018 10:24 AM
Here is my code
void DisplayReport()
{
crypt.Load(Server.MapPath("DetailsRep.rpt"));
SqlDataAdapter sda = new SqlDataAdapter("RptDetails", con);
sda.SelectCommand.CommandType = CommandType.StoredProcedure;
sda.SelectCommand.Parameters.Add("@Date1", SqlDbType.Date).Value =(datepicker.Text);
sda.SelectCommand.Parameters.Add("@Date2", SqlDbType.Date).Value = (datepicker2.Text);
sda.SelectCommand.Parameters.Add("@User", System.Data.SqlDbType.VarChar, 100).Value = lblUser.Text;
DataSet st = new DataSet();
sda.Fill(st, "Details");
crypt.SetDataSource(st);
CrystalReportViewer1.ReportSource = crypt;

Answers (1)