中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

網(wǎng)站服務器在那里找/優(yōu)秀軟文范例200字

網(wǎng)站服務器在那里找,優(yōu)秀軟文范例200字,深圳畫冊設(shè)計排版,做網(wǎng)站用什么后綴好SQLite數(shù)據(jù)庫,小巧但功能強大;并且是基于文件型的數(shù)據(jù)庫,驅(qū)動庫就是一個dll文件,有些開發(fā)工具 甚至不需要帶這個dll,比如用Delphi開發(fā),用一些三方組件;數(shù)據(jù)庫也是一個文件,雖然是個文…

SQLite數(shù)據(jù)庫,小巧但功能強大;并且是基于文件型的數(shù)據(jù)庫,驅(qū)動庫就是一個dll文件,有些開發(fā)工具
甚至不需要帶這個dll,比如用Delphi開發(fā),用一些三方組件;數(shù)據(jù)庫也是一個文件,雖然是個文件,但卻
具有關(guān)系型數(shù)據(jù)庫的大多數(shù)特征,查詢語句也是長得基本一樣,所以對應學習數(shù)據(jù)庫操作很方便。
比起前微軟的Access數(shù)據(jù)庫那只能說,SQLite強大的太多。

在 Visual Studio 中,可以通過以下步驟安裝:

打開 Visual Studio,點擊 "工具" -> "NuGet 包管理器" -> "管理解決方案的 NuGet 包" - 在搜索框中輸入 "SQLite",然后安裝 "System.Data.SQLite" 包。

打開VS,新建一個.NET項目,選擇 C# Windows 桌面,Windows窗體應用(.NET Framework)

界面上拖放相應控件

關(guān)鍵事件代碼 如下

        private void button8_Click(object sender, EventArgs e){string dataSource = "test.db"; // 數(shù)據(jù)庫文件名// 連接數(shù)據(jù)庫using (SQLiteConnection connection = new SQLiteConnection($"Data Source={dataSource};Version=3;")){connection.Open(); // 打開連接// 創(chuàng)建表string createTableQuery = "CREATE TABLE IF NOT EXISTS Customers (Id INTEGER PRIMARY KEY, Name TEXT, Age INT,Phone TEXT)";using (SQLiteCommand createTableCommand = new SQLiteCommand(createTableQuery, connection)){createTableCommand.ExecuteNonQuery(); // 執(zhí)行創(chuàng)建表的SQL語句}// 插入數(shù)據(jù)string insertDataQuery = "INSERT INTO Customers (Name, Age, Phone) VALUES (@Name, @Age, @Phone)";using (SQLiteCommand insertDataCommand = new SQLiteCommand(insertDataQuery, connection)){insertDataCommand.Parameters.AddWithValue("@Name", "John"); // 設(shè)置參數(shù)值,避免SQL注入insertDataCommand.Parameters.AddWithValue("@Age", 25);insertDataCommand.Parameters.AddWithValue("@Phone", "123456");insertDataCommand.ExecuteNonQuery(); // 執(zhí)行插入數(shù)據(jù)的SQL語句}// 查詢數(shù)據(jù)string selectDataQuery = "SELECT * FROM Customers";using (SQLiteCommand selectDataCommand = new SQLiteCommand(selectDataQuery, connection)){using (SQLiteDataReader reader = selectDataCommand.ExecuteReader()){while (reader.Read()){int id = Convert.ToInt32(reader["Id"]); string name = Convert.ToString(reader["Name"]);int age = Convert.ToInt32(reader["Age"]);string phone = Convert.ToString(reader["Phone"]);Console.WriteLine($"ID: {id}, Name: {name}, Age: {age}, Phone: {phone}");}}}SQLiteCommand sqlCommand = new SQLiteCommand("select * from Customers", connection);sqlCommand.ExecuteNonQuery();DataTable dataTable = new DataTable("Customers");SQLiteDataAdapter sqlAdapter = new SQLiteDataAdapter(sqlCommand);sqlAdapter.Fill(dataTable);dataGridView1.DataSource = dataTable.DefaultView;sqlAdapter.Update(dataTable);}}

程序運行結(jié)果

http://www.risenshineclean.com/news/573.html

相關(guān)文章:

  • 做兼職什么網(wǎng)站/企業(yè)網(wǎng)絡營銷策略案例
  • 如何做網(wǎng)站窗口/關(guān)鍵詞整站優(yōu)化
  • 建筑培訓網(wǎng)站有哪些/重慶seo培訓
  • 產(chǎn)品展示型的網(wǎng)站功能有哪些/網(wǎng)上推廣專員是什么意思
  • 豬八戒網(wǎng)站 怎么做兼職/品牌策劃公司介紹
  • 樂平市網(wǎng)站建設(shè)/網(wǎng)絡營銷ppt案例
  • 福田做商城網(wǎng)站建設(shè)哪家公司靠譜/百度推廣是怎么做的
  • 外國客戶網(wǎng)站/營銷策劃公司取名大全
  • 網(wǎng)站后綴是nl是哪個國家/想要導航推廣網(wǎng)頁怎么做
  • php一臺電腦做網(wǎng)站/百度人工
  • 學做網(wǎng)站買什么樣的書/發(fā)布新聞稿
  • 網(wǎng)站建設(shè)公司建設(shè)/市場調(diào)研分析報告
  • 網(wǎng)站地圖 seo/武漢百度關(guān)鍵詞推廣
  • 我的世界有什么做的視頻網(wǎng)站/家庭優(yōu)化大師免費下載
  • app界面生成器/seo1搬到哪里去了
  • 怎么做刷會員的網(wǎng)站/seo排名點擊器曝光行者seo
  • 用cn作網(wǎng)站行么/企業(yè)關(guān)鍵詞大全
  • 公司網(wǎng)站制作內(nèi)容/2022年今天新聞聯(lián)播
  • 海淘返利網(wǎng)站怎么做/上海網(wǎng)絡營銷上海網(wǎng)絡推廣
  • 國內(nèi)出名網(wǎng)站建設(shè)設(shè)計公司/qq推廣軟件
  • 亞馬遜雨林破壞現(xiàn)狀/文章優(yōu)化關(guān)鍵詞排名
  • 靈璧零度網(wǎng)站建設(shè)/國際新聞最新
  • wordpress 上傳文件中文亂碼/西安搜索引擎優(yōu)化
  • 中企動力青島分公司/寧波seo關(guān)鍵詞如何優(yōu)化
  • 中國建設(shè)銀行人力資源網(wǎng)站/營銷互聯(lián)網(wǎng)推廣公司
  • 做站群的網(wǎng)站要備案嗎/電商網(wǎng)站平臺搭建
  • 微信商城與網(wǎng)站一體/谷歌瀏覽器下載手機版中文
  • 微信推送在哪個網(wǎng)站做/百度seo排名優(yōu)化技巧分享
  • 聚民網(wǎng)網(wǎng)站建設(shè)/海外網(wǎng)絡推廣方案
  • 百度云怎么做網(wǎng)站/怎么給網(wǎng)站做優(yōu)化