That's not actually the issue.  When I run the query using the SQLite console 
or via another driver, (for example using 0xDBE + Xerial), the column names are 
returned exactly as they are specified in the query.

The problem is that all of the column names return the same string: "Country", 
surely this isn't the expected behavior? How am I supposed to tell the columns 
apart other than their ordinal position?

I can change the way the columns are specified in the SQL statement, but the 
statement appears to be correct, and like I mentioned, the ADO.Net 
implementation of the SQLite driver seems to be the only one having this issue.

Thanks,

-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
Sent: Wednesday, August 27, 2014 4:39 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Possible bug in System.Data.Sqlite.Core (ADO.Net)


On 27 Aug 2014, at 8:30pm, Zachary Yates <zachary.ya...@orolia.com> wrote:

> When I use SQLiteCommand.ExecuteReader(), the IDataReader.GetName(i) method 
> returns only the table name, in my case "Country".

You do not provide your own names for the columns returned.  Therefore SQLite 
is free to use whatever column names it likes including ones which make no 
sense to you.  If you find it useful to have certain column names, then specify 
them yourself, like the following:

SELECT "Country"."Id" AS CId, "Country"."Code" AS CCode, "Country"."Title" AS 
CTitle ...

You might get behaviour more to your liking by omitting the quotes around table 
and column names, since they aren't needed.  However the same rule applies: if 
you do not provide your own names for columns in the result, SQLite can pick 
whatever it wants.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to