久久久久久久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的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在使用此查詢向表中插入日期:

                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();
                

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

                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(); 
                

                離開

                param.Value = dt; 
                

                你正試圖在 DateTime 字段中插入一個字符串 - 肯定 PostgreSQL 會抱怨.

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

                如果你想避免丟失時間信息,請使用 NpgsqlTypes.NpgsqlDbType.Timestamp

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

                這篇關于PostgreSQL 日期 C# DateTime的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                  <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>
                          主站蜘蛛池模板: 日本免费在线观看视频 | 日韩精品视频在线 | 国产精品久久一区二区三区 | 国产综合第一页 | 日日骚av | 国产精品免费看 | 亚洲最新网址 | 久久精品视频99 | 成人午夜在线视频 | 色免费在线视频 | 能免费看的av | 亚洲成人精品一区 | 高清黄色网址 | 欧美一级视频免费看 | 荷兰欧美一级毛片 | 国产精品揄拍一区二区 | 国产精品99久久久久久www | 91极品尤物在线播放国产 | 亚洲www| 高清人人天天夜夜曰狠狠狠狠 | 午夜精品一区二区三区在线观看 | 少妇一级淫片免费放播放 | 懂色tv| 精精国产xxxx视频在线播放 | 成人免费网站www网站高清 | 91精品国产91久久久久福利 | 99只有精品 | 精品视频在线观看 | 中文字幕不卡在线观看 | 中文字幕第一页在线 | 91婷婷韩国欧美一区二区 | 亚洲欧美在线观看视频 | 亚洲免费一区 | 成年人在线观看 | 国产日韩精品一区 | 亚洲av一级毛片 | 2018天天干天天操 | 国产在线看片 | 久久精品免费 | 91精品国产91久久久久久吃药 | 99精品视频网 |