当前位置:首页 > 数据库 > SQlite

Sqlite 的简单应用

hisine.db"); m_dbConnection = new SQLiteConnection("Data Source=hisine.db;Version=3;"); m_dbConnection.Open(); string sql = "create table orders (创建时间,商品信息,商品id,付款金额,效果预估,订单编号,广告位名称,退款日期)"; SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection); command.ExecuteNonQuery();
m_dbConnection.Close();

 

将查询到的sql语句返回到DataTable

private DataTable SqlQueryDataTable(string sql)//将sql语句的查询记录返回到DataTable
        {
            DataTable table = new DataTable();
            if (m_dbConnection.State != ConnectionState.Open)
                return table;
            SQLiteCommand cmd = new SQLiteCommand(sql, m_dbConnection);
            SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter();
            dataAdapter.SelectCommand = cmd;
            dataAdapter.Fill(table);
            return table;
        }

 

Sqlite 的简单应用

标签:com   简单   code   sqlite   create   string   退款   nec   str   

本文系统来源:http://www.cnblogs.com/cxlater/p/6686044.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!