mercredi 23 décembre 2015

SQLite Inner Join query in C# not returning any data even though in the DB Browser it does

I am using the following query in C# and it does not return any data:

var commandText = 
            "SELECT m.Id, m.LastName, m.FirstName, m.MembershipStartDate as     StartDate, m.MembershipEndDate as EndDate, t.Id as TierId, t.Name, t.Value as Dues " +
            "FROM Member m " +
            "INNER JOIN MembershipTiers t ON m.MemberShipTierId = t.Id";

var command = _connection.CreateCommand();
command.CommandText = commandText;
command.CommandType = CommandType.Text;

SQLiteDataReader reader = command.ExecuteReader();

When I run this in the DB Browser for SQLite is works fine.

Successful Query

When I get rid of the INNER JOIN it works fine.

Aucun commentaire:

Enregistrer un commentaire