sqlserver中的分区概念 [英] Partition concept in sqlserver

查看:77
本文介绍了sqlserver中的分区概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在gridview中显示结果,就像Datalist一样。

我通过使用Datalist实现了这一点,如下所示。我需要在Gridview中完成这项任务。

帮助我。给我一个主意。我的一位朋友告诉我,通过使用分区,我们可以完成这项任务。如何在sqlserver中使用分区概念执行此任务?



I want to show the result in gridview as like Datalist.
I achieved this by using Datalist as given below. I need to do that task in Gridview.
Help me. Give me an idea. One of my friend told, by using Partitioning we can do this task. How to do this task using Partition concept in sqlserver?

<div>
        <asp:DataList ID="GV_Product" runat="server" CellSpacing="3" CellPadding="2" RepeatColumns="2" Width="200px" Height="200px">

       <ItemTemplate>

            <table>

            <tr>
                <td class="auto-style2" colspan="3" style="text-align: center; font-size: large">Product</td>
            </tr>
                <tr>
                    <td class="auto-style1" colspan="3" style="text-align: center; font-size:small" >
                        <asp:CheckBox ID="chk" runat="server" /></td>
                </tr>
            <tr>
                <td>Product Name </td>
                <td>
                    <asp:Label ID="lblPrdName" runat="server" Text='<%#Bind("P_Name") %>'></asp:Label></td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td>Product Price </td>
                <td>
                    <asp:Label ID="lblPrdPrice" runat="server" Text='<%#Bind("P_Price") %>'></asp:Label></td>
            </tr>
            <tr>
                <td>Quantity               </td>
                <td>
                    <asp:TextBox ID="txt_Qty" runat="server" Enabled="false" AutoPostBack="true" ></asp:TextBox></td>
                <asp:RegularExpressionValidator ID="REV_Qty" runat="server" ErrorMessage="Provide the Qty in Correct Format" ControlToValidate="txt_Qty" ValidationExpression="^[0-9]+$"></asp:RegularExpressionValidator>

                <td>Total Quantity
                    <asp:Label ID="lblTotQty" runat="server" Text=""></asp:Label></td>
            </tr>
            <tr>
                <td>Amount</td>
                <td>
                    <asp:Label ID="lblTotal" runat="server" Text=""></asp:Label></td>
                <td>Total Amount
                    <asp:Label ID="lblTotAmt" runat="server" Text=""></asp:Label>
                </td>
            </tr>


                </table>
           </ItemTemplate>
             </asp:DataList>


    </div>

推荐答案

> < / asp:RegularExpressionValidator >

< td > 总数量
< asp:标签 ID = lblTotQty runat = server 文本 = > < / asp:Label > < / td >
< / tr >
< tr >
< td > 金额< / td >
< td >
< asp:标签 ID = lblTotal runat = server 文字 = > < / asp:Label > < / td >
< td > 总金额
< asp:标签 ID = lblTotAmt runat = 服务器 文本 = > < / asp:Label >
< / td >
< / tr >


< / table >
< / ItemTemplate >
< / asp:DataList >


< / div >
"></asp:RegularExpressionValidator> <td>Total Quantity <asp:Label ID="lblTotQty" runat="server" Text=""></asp:Label></td> </tr> <tr> <td>Amount</td> <td> <asp:Label ID="lblTotal" runat="server" Text=""></asp:Label></td> <td>Total Amount <asp:Label ID="lblTotAmt" runat="server" Text=""></asp:Label> </td> </tr> </table> </ItemTemplate> </asp:DataList> </div>


问题不清楚。

任何方式试试这个!..



Question is not Clear.
Any Way Try this!..

<asp:gridview id="GridView1" runat="server" showfooter="True" xmlns:asp="#unknown">
            AutoGenerateColumns="False">
<columns>
 <asp:templatefield>
<table>
 
            <tr>
                <td class="auto-style2" colspan="3" style="text-align: center; font-size: large">Product</td>
            </tr>
                <tr>
                    <td class="auto-style1" colspan="3" style="text-align: center; font-size:small">
                        <asp:checkbox id="chk" runat="server" /></td>
                </tr>
            <tr>
                <td>Product Name </td>
                <td>
                    <asp:label id="lblPrdName" runat="server" text="<%#Bind("P_Name") %>"></asp:label></td>
                <td> </td>
            </tr>
            <tr>
                <td>Product Price </td>
                <td>
                    <asp:label id="lblPrdPrice" runat="server" text="<%#Bind("P_Price") %>"></asp:label></td>
            </tr>
            <tr>
                <td>Quantity               </td>
                <td>
                    <asp:textbox id="txt_Qty" runat="server" enabled="false" autopostback="true"></asp:textbox></td>
                <asp:regularexpressionvalidator id="REV_Qty" runat="server" errormessage="Provide the Qty in Correct Format" controltovalidate="txt_Qty" validationexpression="^[0-9]+


> < span class =code-keyword>< / asp:regularexpressionvalidator >

< td>总数量
< asp:label id = lblTotQty runat = server text = > < / asp:label > < / td >
< / tr >
< tr>
< td>金额< / td >
< td>
< asp:label id = lblTotal runat = server text = > < / asp:标签 > < / td >
< td>总金额
< asp:label id = lblTotAmt runat = 服务器 text = > < / asp:label >
< / td >
< / tr >


< / 表格 >

< ; / asp:templatefield >
< / >
< / asp:gridview >
"></asp:regularexpressionvalidator> <td>Total Quantity <asp:label id="lblTotQty" runat="server" text=""></asp:label></td> </tr> <tr> <td>Amount</td> <td> <asp:label id="lblTotal" runat="server" text=""></asp:label></td> <td>Total Amount <asp:label id="lblTotAmt" runat="server" text=""></asp:label> </td> </tr> </table> </asp:templatefield> </columns> </asp:gridview>





然后将您的数据集绑定到Gridview





then bind your dataset into Gridview

GridView1.DataSource = ds;
GridView1.DataBind();


这篇关于sqlserver中的分区概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆