public ActionResult search(DateTime StartDate, DateTime enddate)
{
string EmpVisitor = @"Data Source=UTSIN-15;User ID=sa;Password=unified;Initial Catalog=EmpVisitor;MultipleActiveResultSets=True;Application Name=EntityFramework";
DataTable dtbl = new DataTable();
using (SqlConnection sqlcon = new SqlConnection(EmpVisitor))
{
sqlcon.Open();
SqlDataAdapter sqlda = new SqlDataAdapter("select * from dbo.visitordetails where Date Between '" + StartDate + "' And '" + enddate + "'", sqlcon);
sqlda.Fill(dtbl);
//return RedirectToAction("List");
}
return View(dtbl);
}
-------------------------------------------------------------------------
im getting the datatable empty
Nilesh ShahPosted Nov 2, 2017, 11:56 AM
Lakshmikanth ChowdaryPosted Nov 2, 2017, 1:54 PM
Lakshmikanth ChowdaryPosted Nov 2, 2017, 11:35 AM
Nilesh ShahPosted Nov 1, 2017, 4:38 PM