user11065510
user11065510

Reputation:

In xamarin forms can use sql query

I need to retrieve data from my local database.in xamarin forms it uses linq.can i use SQL query instead of linq

Upvotes: 1

Views: 1079

Answers (1)

EvZ
EvZ

Reputation: 12179

There is official documentation that answers your question:

Xamarin.Forms applications can use the SQLite.NET PCL NuGet package to incorporate database operations into shared code by referencing the SQLite classes that ship in the NuGet. Database operations can be defined in the .NET Standard library project of the Xamarin.Forms solution.

and example from the same doc:

public Task<List<TodoItem>> GetItemsNotDoneAsync()
{
  return database.QueryAsync<TodoItem>("SELECT * FROM [TodoItem] WHERE [Done] = 0");
}

Upvotes: 1

Related Questions