SQLite PRAGMA table_info(table) not returning column names (using Data.SQLite in C#)
<p>I use the following example code and want to get the column names of a sqlite3 database in some way:</p>

<pre><code>using System;
using System.Data.SQLite;
namespace Program
{
class Program
{
    static void Main(string[] args)
    {
        Program stuff = new Program();
        stuff.DoStuff();
        Console.Read();
    }
    private void DoStuff()
    {
        SQLiteConnection.CreateFile("Database.sqlite");
        SQLiteConnection con = new SQLiteConnection("Data Source=Database.sqlite;Version=3;");
        con.Open();
        string sql = "create table 'member' ('account_id' text not null unique, 'account_name' text not null);";
        SQLiteCommand command = new SQLiteCommand(sql, con);
        command.ExecuteNonQuery();
        sql = "insert into member ('account_id', 'account_name') values ('0', '1');";
        command = new SQLiteCommand(sql, con);
        sql = "PRAGMA table_info('member');";
        command = new SQLiteCommand(sql, con);
        SQLiteDataReader reader = command.ExecuteReader();
        while (reader.Read())
        {
            Console.WriteLine(reader.GetName(0));
        }
        con.Close();
    }

}
}
</code></pre>

<p>I also tried</p>

<pre><code>for(int i=0;i&lt;reader.FieldCount;i++)
{
   Console.WriteLine(reader.GetName(i));
}

var columns = Enumerable.Range(0, reader.FieldCount).Select(reader.GetName).ToList();
</code></pre>

<p>the only result I get is the following output:
"cid name type notnull dflt_value pk"
I dont get the actual column names though..
I do need the column names because I'm writing new columns to the database depending on the result of an API from another server where I dont have access to. When printing the data, I oc want to make sure the correct column names are displayed.</p>