TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arvind Chourasiya
NA
933
134.3k
getting data between two dates
Jun 27 2016 7:15 AM
Dear all,
i have one Repository class(Repository.cs) with some methods for getting the data, methods are
1)
public
async Task<List<T>> Get()
{
return
await _db.Table<T>().ToListAsync();
}
2)
public
async Task<T> Get(Expression<Func<T,
bool
>> predicate)
{
return
await _db.FindAsync<T>(predicate);
}
3)
public
async Task<T> Get(
int
id)
{
return
await _db.FindAsync<T>(id);
}
i have one table Expense..
public
class
Expence : EntityClass
{
public
string
Date {
get
;
set
; }
public
decimal
Amount {
get
;
set
; }
public
string
Purpose_Of_Spending {
get
;
set
; }
public
string
Type {
get
;
set
; }
}
Now i want to get data between two dates from Expense table, how can i do that please help, Here i'm using SQLite database with AsyncSqliteConnection
i have tried like that
public
async
void
queryvals()
{
Repository<Expence> repo =
new
Repository<Expence>();
SQLiteAsyncConnection con = DatabaseAccess.GetConnection();
var DateData = con.QueryAsync<Expence>(
"SELECT * FROM Expence WHERE Date between '"
+ FrmDate.Text +
"' AND '"
+ ToDate.Text +
"'"
);
var DatesData2 = await repo.Get(x => (x.Date == ToDate.Text) && (x.Date == FrmDate.Text));
}
but i'm not getting the data, how should i do that can anyone suggest me.Thank you
Reply
Answers (
3
)
Unable to get number of copies of a print job in C#
How to insert Data into Database using Three Tier Architectu