Wayne
Wayne

Reputation: 363

Execute join statement with sqlite-net for WP8

I'm using https://github.com/peterhuene/sqlite-net-wp8 for my WP8 project. I want to use joins event without automatical objects casting (like Query). Is there any method there to execute any query and then manually fetch result rows?

Upvotes: 1

Views: 830

Answers (1)

Jaihind
Jaihind

Reputation: 2778

Yes you can execute any query and manually fetch rows. this might help you out. First you need to create a class that hold properties like -

 public class student
    {
    public int id{get;set;}
    public string StudentName{get;set;}
    public string ClassName{get;set;}
    }

After that create connection with database`.
You want to select id,StudentName from tableOne and ClassName from tableTwo


string query="SELECT tableOne.id,tableOne.StudentName.....your query with join";
 SQLiteCommand command = dbcon.CreateCommand(query);

var Data = command.ExecuteQuery<student>();

Upvotes: 3

Related Questions