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

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

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

    2. <legend id='RXE5L'><style id='RXE5L'><dir id='RXE5L'><q id='RXE5L'></q></dir></style></legend>

      PostgreSQL 日期 C# DateTime

      PostgreSQL date C# DateTime(PostgreSQL 日期 C# DateTime)

        <tfoot id='WIZUA'></tfoot>
          <bdo id='WIZUA'></bdo><ul id='WIZUA'></ul>

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

                <tbody id='WIZUA'></tbody>
            1. <i id='WIZUA'><tr id='WIZUA'><dt id='WIZUA'><q id='WIZUA'><span id='WIZUA'><b id='WIZUA'><form id='WIZUA'><ins id='WIZUA'></ins><ul id='WIZUA'></ul><sub id='WIZUA'></sub></form><legend id='WIZUA'></legend><bdo id='WIZUA'><pre id='WIZUA'><center id='WIZUA'></center></pre></bdo></b><th id='WIZUA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WIZUA'><tfoot id='WIZUA'></tfoot><dl id='WIZUA'><fieldset id='WIZUA'></fieldset></dl></div>
                <legend id='WIZUA'><style id='WIZUA'><dir id='WIZUA'><q id='WIZUA'></q></dir></style></legend>
                本文介紹了PostgreSQL 日期 C# DateTime的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                限時(shí)送ChatGPT賬號(hào)..

                我正在使用此查詢(xún)向表中插入日期:

                I'm using this query to insert into a table a date:

                DateTime dt = DateTime.Now;
                String query = "Insert into "Table1" ("tableDate") values (:date1)";
                NpgsqlConnection conn = new NpgsqlConnection(conex.getConnection());
                conn.Open();
                NpgsqlCommand cmd = new NpgsqlCommand(query, conn);
                NpgsqlParameter param = new NpgsqlParameter(":date1",NpgsqlTypes.NpgsqlDbType.Date);
                param.Value = dt.ToShortDateString();
                cmd.Parameters.Add(param); // <----------Here i get the error
                cmd.ExecuteNonQuery();
                conn.Close();
                

                這就是我在表中插入任何其他值的方式,它可以工作!所以肯定是日期格式什么的有錯(cuò)誤,但是我找不到答案.

                And this is how I am inserting in the table any other value and it works! So there must be an error in the date format or something, but I can't find the answer.

                推薦答案

                別做

                param.Value = dt.ToShortDateString(); 
                

                離開(kāi)

                param.Value = dt; 
                

                你正試圖在 DateTime 字段中插入一個(gè)字符串 - 肯定 PostgreSQL 會(huì)抱怨.

                You're trying to insert a string into DateTime field - sure PostgreSQL will complain.

                如果你想避免丟失時(shí)間信息,請(qǐng)使用 NpgsqlTypes.NpgsqlDbType.Timestamp

                use NpgsqlTypes.NpgsqlDbType.Timestamp if you want to avoid losing the time information

                這篇關(guān)于PostgreSQL 日期 C# DateTime的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                What are good algorithms for vehicle license plate detection?(車(chē)牌檢測(cè)有哪些好的算法?)
                onClick event for Image in Unity(Unity中圖像的onClick事件)
                Running Total C#(運(yùn)行總 C#)
                Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時(shí)刪除目錄)
                asp.net listview highlight row on click(asp.net listview 在單擊時(shí)突出顯示行)
                Calling A Button OnClick from a function(從函數(shù)調(diào)用按鈕 OnClick)
                  <tbody id='n9UrE'></tbody>
                <legend id='n9UrE'><style id='n9UrE'><dir id='n9UrE'><q id='n9UrE'></q></dir></style></legend>

                1. <small id='n9UrE'></small><noframes id='n9UrE'>

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

                      • <tfoot id='n9UrE'></tfoot>
                          主站蜘蛛池模板: 亚洲欧洲日韩精品 中文字幕 | 四虎影音 | 国产精品久久久久一区二区三区 | 国产丝袜一区二区三区免费视频 | 91 久久| www视频在线观看 | 日本一二区视频 | 成人国产精品一级毛片视频毛片 | 日韩乱码在线 | 亚洲一区中文字幕在线观看 | 无码日韩精品一区二区免费 | 九九精品在线 | 中文在线视频观看 | 国产精品免费看 | 干狠狠| 国产免费观看视频 | 欧美一区二区免费视频 | 国产精品国产a | 久草免费在线视频 | 中文字幕国产在线 | 国产亚洲精品久久久久动 | 五月综合激情在线 | 国产婷婷 | 午夜性色a√在线视频观看9 | 日日夜夜av | 中国一级大黄大片 | 国产一区欧美 | 欧美日韩国产欧美 | 日本欧美国产在线观看 | 亚洲 自拍 另类 欧美 丝袜 | 91精品麻豆日日躁夜夜躁 | 性一交一乱一透一a级 | av看看 | 国产视频1区 | 日本一区二区高清不卡 | 亚洲视频免费在线 | www.av7788.com| 成人三级视频在线观看 | 亚洲成人一二区 | 国产免费一级片 | 99只有精品 |