*** 作sqlite

 *** 作sqlite,第1张

概述static string connStr = "Data Source=d:\\test.db"; static void Main(string[] args) { SQLiteConnection conn = new SQLiteConnection(connStr); SQLiteCommand cmd = conn.Cre
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();
总结

以上是内存溢出为你收集整理的 *** 作sqlite全部内容,希望文章能够帮你解决 *** 作sqlite所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/1165042.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-01
下一篇2022-06-01

发表评论

登录后才能评论

评论列表(0条)

    保存