static string connStr = "Data Source=d:\\test.db"; static void Main(string[] args) { sqliteConnection conn = new sqliteConnection(connStr); sqliteCommand cmd = conn.CreateCommand(); string sql = "select * from admin"; conn.Open(); cmd.CommandText = sql; IDataReader dr = cmd.ExecuteReader(); //输出列名,FieldCount 是列长度 for (int i = 0; i < dr.FieldCount; ++i) Console.Write(dr.GetName(i) + "\t"); Console.WriteLine(); //输出一行,先read while (dr.Read()) { Console.Out.WriteLine(dr.GetString(0) + "\t" + dr.GetString(1)); } Console.Read();