久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <i id='TE3NO'><tr id='TE3NO'><dt id='TE3NO'><q id='TE3NO'><span id='TE3NO'><b id='TE3NO'><form id='TE3NO'><ins id='TE3NO'></ins><ul id='TE3NO'></ul><sub id='TE3NO'></sub></form><legend id='TE3NO'></legend><bdo id='TE3NO'><pre id='TE3NO'><center id='TE3NO'></center></pre></bdo></b><th id='TE3NO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TE3NO'><tfoot id='TE3NO'></tfoot><dl id='TE3NO'><fieldset id='TE3NO'></fieldset></dl></div>

      1. <legend id='TE3NO'><style id='TE3NO'><dir id='TE3NO'><q id='TE3NO'></q></dir></style></legend>
          <bdo id='TE3NO'></bdo><ul id='TE3NO'></ul>

      2. <small id='TE3NO'></small><noframes id='TE3NO'>

        <tfoot id='TE3NO'></tfoot>

        SQL 命令 INSERT 正在工作,但數據未出現在表中

        SQL command INSERT is working but the data not appear in table(SQL 命令 INSERT 正在工作,但數據未出現在表中)

          <bdo id='cfSAi'></bdo><ul id='cfSAi'></ul>

              <tbody id='cfSAi'></tbody>
          1. <i id='cfSAi'><tr id='cfSAi'><dt id='cfSAi'><q id='cfSAi'><span id='cfSAi'><b id='cfSAi'><form id='cfSAi'><ins id='cfSAi'></ins><ul id='cfSAi'></ul><sub id='cfSAi'></sub></form><legend id='cfSAi'></legend><bdo id='cfSAi'><pre id='cfSAi'><center id='cfSAi'></center></pre></bdo></b><th id='cfSAi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cfSAi'><tfoot id='cfSAi'></tfoot><dl id='cfSAi'><fieldset id='cfSAi'></fieldset></dl></div>
              <tfoot id='cfSAi'></tfoot>
                <legend id='cfSAi'><style id='cfSAi'><dir id='cfSAi'><q id='cfSAi'></q></dir></style></legend>

                <small id='cfSAi'></small><noframes id='cfSAi'>

                • 本文介紹了SQL 命令 INSERT 正在工作,但數據未出現在表中的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在使用 MS VS 2010 Express Edition 在我的 Visual C#.NET 中像這樣執行 SQL 命令 INSERT:

                  I am executing SQL command INSERT like this in my Visual C#.NET using MS VS 2010 Express Edition:

                  private void btnAdd_Click(object sender, EventArgs e)
                  {
                       SqlConnection con = new SqlConnection(Properties.Settings.Default.loginDBConnectionString);
                       con.Open();
                       SqlCommand cmd = new SqlCommand("INSERT INTO tblEmp (ID, firstname, lastname, email, position) VALUES ('"+textBox1.Text+"','"+textBox2.Text+"', '"+textBox3.Text+"', '"+textBox4.Text+"', '"+comboBox1.Text+"')", con);
                       cmd.ExecuteNonQuery();
                       con.Close();
                       MessageBox.Show("Data Added!");
                  }
                  

                  執行時出現MessageBox,表示執行成功.但是,當我檢查表格時,我之前嘗試插入的數據根本沒有出現.

                  When executing this, the MessageBox showed up which means the execution was successful. But, when I checked on the table , the data that I am trying to insert before isn't appear at all.

                  我有一個數據庫(loginDB.mdf),里面有 2 個表:- TblLogin - 包含 usernamepassword 用于成功執行的登錄目的.- tblEmp - 包含員工數據,這是我嘗試插入數據的數據.

                  I have one database (loginDB.mdf) with 2 tables inside : - TblLogin - contains username and password for login purpose which executed successfully. - tblEmp - contains employee data, this is the one that I tried to insert data to.

                  我不明白的是為什么 MessageBox 實際上沒有插入到我的 tblEmp 中.

                  What I don't understand is why the MessageBox appear when in fact none inserted into my tblEmp.

                  編輯:ConnectionStringloginDB.mdf:

                  Data Source=.SQLEXPRESS;AttachDbFilename="C:UsersAndreasdocumentsvisual studio 2010ProjectsLoginApplicationLoginApplicationloginDB.mdf";Integrated Security=True;User Instance=True
                  

                  數據庫名稱是 loginDB.mdf 而不是之前寫的 logindatabase.mdf.我把它改成 loginDB.mdf 只是為了測試它,但仍然沒有出現任何變化.

                  The database name is loginDB.mdf instead of logindatabase.mdf as previously written. I changed it to loginDB.mdf just to test it, but still no changes appear.

                  推薦答案

                  如果您的 c# 代碼執行時沒有任何異常,它也會更新數據庫.您可能在 ConnectionString 中使用過 AttachDbFilename=|DataDirectory|yourDB.mdf,這意味著更新的數據庫位于子文件夾 BINDEBUG 項目的文件夾.如果您想查看更新的數據,只需附加位于 ssms 中 bin/debug 文件夾中的數據庫.有關詳細信息,請閱讀 此 帖子.還要確保服務器資源管理器中的表尚未打開,如果它已經打開,則必須刷新它以顯示更新的數據.請注意:正如評論中提到的,您應該始終使用參數化查詢來避免Sql 注入.

                  If your c# code executes without any exceptions, it updates the database too. You have probably used AttachDbFilename=|DataDirectory|yourDB.mdf in your ConnectionString, that means the databse that is updated is located in the subfolder BINDEBUG folder of your project. If you want to see the updated data just attach the database located in the bin/debug folder in ssms. for more details read this post. Also make sure your table in server explorer is not already open, if it is already open you must refresh it to show updated data. Please note:as mentioned in the comments you should always use parameterized queries to avoid Sql Injection.

                  這篇關于SQL 命令 INSERT 正在工作,但數據未出現在表中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數調用按鈕 OnClick)

                  <tfoot id='6gcdr'></tfoot>

                          <tbody id='6gcdr'></tbody>
                      1. <small id='6gcdr'></small><noframes id='6gcdr'>

                        • <bdo id='6gcdr'></bdo><ul id='6gcdr'></ul>
                          <i id='6gcdr'><tr id='6gcdr'><dt id='6gcdr'><q id='6gcdr'><span id='6gcdr'><b id='6gcdr'><form id='6gcdr'><ins id='6gcdr'></ins><ul id='6gcdr'></ul><sub id='6gcdr'></sub></form><legend id='6gcdr'></legend><bdo id='6gcdr'><pre id='6gcdr'><center id='6gcdr'></center></pre></bdo></b><th id='6gcdr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6gcdr'><tfoot id='6gcdr'></tfoot><dl id='6gcdr'><fieldset id='6gcdr'></fieldset></dl></div>
                          • <legend id='6gcdr'><style id='6gcdr'><dir id='6gcdr'><q id='6gcdr'></q></dir></style></legend>

                          • 主站蜘蛛池模板: 色婷婷久久久亚洲一区二区三区 | 午夜爱爱网 | 91国内在线观看 | 国产成人亚洲精品 | 欧美 日韩 国产 成人 | 精品视频在线一区 | 国产精品v | 狠狠操狠狠色 | 亚洲三区在线观看 | 黄a网站 | 91免费版在线| 欧美一区2区三区3区公司 | 蜜臀av日日欢夜夜爽一区 | 99热精品在线 | 毛片一区二区三区 | 精品国模一区二区三区欧美 | 久久久99精品免费观看 | 91观看| 亚洲精品视频免费观看 | 四虎影院在线观看免费视频 | 在线中文字幕日韩 | 色黄网站 | 国产超碰人人爽人人做人人爱 | a免费视频 | 国产成人av在线 | 69电影网| 一级黄a视频 | 国产精品日韩一区 | 日本韩国欧美在线观看 | 自拍偷拍一区二区三区 | 久久久久久久久久久一区二区 | 天天干狠狠操 | 国产在线一区二 | 日韩综合 | 国产乱精品一区二区三区 | 欧美日韩在线一区二区三区 | 美女一级a毛片免费观看97 | 可以免费观看的av | 狠狠干狠狠操 | 亚洲高清在线 | 亚洲一区网站 |