.Net開發工作中常遇到的一些問題及解決方案

來源:互聯網
上載者:User

//GridViwe中內容自動換行 
  GridViwe1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");

//GridViwe中隱藏列
在  protected void sgvCapitalDetailList_RowDataBound(object sender, GridViewRowEventArgs e)事件中,添加如下代碼:
  e.Row.Cells[newTable.Columns.Count - 1].Visible = false;

oracle中的函數decode(待比較的對象,如果為這個,那麼結果為這個,否則結果是這個)

SQL分頁
select *,ROW_NUMBER() over(order by pid desc) as num from
photos as t where t.num between 4 and 6 order by pid desc

Oracle OCI-22053:溢出錯誤解決方案

Oracle 數值資料類型最多可儲存 38 個位元組的精度。當將 Oracle 數值轉換為公用語言運行庫資料類型時,小數點後邊的位元可能過多,這會導致此錯誤。

解決方案:

使用round()函數:

例如:select min(pval),max(pval),round(avg(pval),5) from hvm_data_dga .

round(avg(pval),5) 使數值小數點後按照四捨五入保留5位。

 

//設定DropDownList選中的值this.ddlDepart.SelectedIndex = ddlDepart.Items.IndexOf(ddlDepart.Items.FindByValue(“0”));輸入金額的驗證運算式ValidationExpression="^\d+(\.\d*)?$" //金額 WdatePicker.js在ie6無法開啟我使用的WdatePicker.js日曆控制項在ie6中無法開啟,瀏覽器報沒有網站。 解決辦法 Js代碼 :.< script src="/admin/blogs/resources/js/time/WdatePicker.js" type="text/javascript"></script><script src="./resources/js/time/WdatePicker.js" type="text/javascript"></script>在引包的時候,加入defer="defer" 就好了。彈出對話方塊進行操作後重新整理父頁面前台代碼:      <script type="text/javascript">
  function Edit(url) {
            var openobj = window;
            if (typeof (window.dialogArguments) == "object") {
                openobj = window.dialogArguments;
            }
            showPopWin(url, 800, 700, openobj);
        }
</script>                         
<span class="chaxun">
                                    <asp:LinkButton ID="lbtnSelect" runat="server" OnClick="lbtnSelect_Click">查詢</asp:LinkButton>
                                </span>&nbsp;<span class="xinzeng">
                                    <asp:LinkButton ID="lbtnAdd" runat="server" OnClick="lbtnSelect_Click">新增</asp:LinkButton></span>
                   </div>後台代碼: protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {                //為新增按鈕添加js事件
                lbtnAdd.Attributes.Add("onclick", "showPopWindow('QualityValidate.aspx?OperType=Add&btnQuery=" + lbtnSelect.ClientID + "','800','700');");
                BindList();
            }
        }

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.