Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have 2 text box if i enter 2 dates in the two textbox and click the button it will generate all the details from the database in between 2 dates.

use asp.net rozer file
Posted
Comments
PIEBALDconsult 16-Jun-15 1:17am    
Kewl, show us how you did it.
deepankarbhatnagar 16-Jun-15 1:23am    
Please explain and show your code.
Member 11755579 16-Jun-15 8:31am    
only one rows it showing not the all rows between them

1 solution

[HttpPost]
public ActionResult CashReceipt(string FromDate, string ToDate)
{
List<cashreceipts> adList = new List<cashreceipts>();
CashReceipts crObj = new CashReceipts();
DataSet ds = new DataSet();
string fromDate = Convert.ToString(FromDate);
string toDate = Convert.ToString(ToDate);
Cashrecetps cr = new Cashrecetps ();
ds = cr.GetReport(fromDate, toDate);
if (ds != null && ds.Tables.Count > 1)

{
for (int record = 0; record <= ds.Tables[0].Rows.Count - 1; record++)
{

dynamic rowLB = ds.Tables[0].Rows[record];
crObj.Date = rowLB("Date").ToString();
crObj.Amount = rowLB("Amount").ToString();
crObj.Description = rowLB("Description").ToString();
crObj.User = rowLB("User").ToString();
}
adList.Add(crObj);
}
return View(crObj);
}
 
Share this answer
 
Comments
PIEBALDconsult 16-Jun-15 19:22pm    
Please use "Improve question" to add detail and context. Do not answer your own question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900