久久久久久久性爱潮,国产又粗又猛又爽又黄下载视频,尤物国产在线一区视频,欧美日本国产在线不卡

<sup id="4uqqy"><ol id="4uqqy"></ol></sup>
  • <th id="4uqqy"></th>

      • <strike id="4uqqy"><nobr id="4uqqy"><ins id="4uqqy"></ins></nobr></strike><sup id="4uqqy"></sup><strong id="4uqqy"><u id="4uqqy"></u></strong>
        <sub id="4uqqy"></sub>

          綠色資源網(wǎng):您身邊最放心的安全下載站! 最新軟件|熱門排行|軟件分類|軟件專題|廠商大全

          綠色資源網(wǎng)

          技術教程
          您的位置:首頁數(shù)據(jù)庫類SQL Server → unity3d怎么連接sql server數(shù)據(jù)庫?

          unity3d怎么連接sql server數(shù)據(jù)庫?

          我要評論 2013/11/18 16:25:37 來源:綠色資源網(wǎng) 編輯:www.kiwanis-srv.org [ ] 評論:0 點擊:366次

          雖然在Unity3D中能夠通過PlayerPrefs類來保存和讀取數(shù)據(jù),但是一旦數(shù)據(jù)量增大,僅僅通過代碼的方式存取數(shù)據(jù),這樣的工作量是非常大的。那么如何通過使用Sql Server數(shù)據(jù)庫來存取數(shù)據(jù)呢?其實過程也非常簡單,過程如下:

          1、找到System.Data.dll文件,默認的地址是在C:\Program Files\Unity\Editor\Data\Mono\lib\mono\unity,這個根據(jù)你所安裝的路徑有關。

          2、將該文件復制到你的工作空間下的Asset文件夾內

          3、在你的編輯器中添加引用,我用的是VS

          4、在命名空間內增加程序集

          using System;

          using System.Data;

          using System.Data.SqlClient;

          5、編寫連接數(shù)據(jù)庫代碼

          SqlConnection con = null;
              SqlDataAdapter sda = null;
              void Start()
              {
                  string s = @"server=.;database=ConnectTest;uid=sa;pwd=123456";    //注意,這里必須使用SQL Server和Windows驗證模式,否則會報錯
                  con = new SqlConnection(s);
                  con.Open();
                  string sql = "select * from table1";
                  sda = new SqlDataAdapter(sql, con);
                  DataSet ds = new DataSet();
                  sda.Fill(ds, "table1");
                  print(ds.Tables[0].Rows[0][0]);
              }

          6、實驗結果

          關鍵詞:unity3d,sql,數(shù)據(jù)庫

          閱讀本文后您有什么感想? 已有 人給出評價!

          • 1 歡迎喜歡
          • 1 白癡
          • 1 拜托
          • 1 哇
          • 1 加油
          • 1 鄙視