用于GridView控制的Gridview-数据库连接 [英] Gridview-Database connectivity for gridview control

查看:72
本文介绍了用于GridView控制的Gridview-数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我正在使用gridview.

gridview包含两列,例如Feesname和Feeamountamount.可以从table1中动态输入Feesname列,我必须输入该Feesname的Feesamount.
在数据库级别,表2包含四列,如id,feetsid,feamountamount.

id-autogenenrated字段,从table1生成的feeid-id(即对应于feename),我动态输入的文本框的feeamount-value值.

我还创建了一个表和设计,但是我不知道如何应用此逻辑.

设计页面编码为:

Hi Friends,

I am using gridview.

The gridview contains two columns like feesname and feesamount. feesname column can entered dynamically from table1, I have to enter the feesamount for that feesname.

At database level, table2 contains four columns like id, feesid, feesamount.

id-autogenenrated field, feesid-id generated from the table1(ie corresponding to feesname), feesamount-valueof the textbox which i have entered dynamically.

I created a table and design also but I don''t know how to apply this logic.

Design page coding is:

<asp:GridView ID="GridView1"  runat="server" AutoGenerateColumns="False"
        ShowFooter="True" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None"
        BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical">
        <RowStyle BackColor="#F7F7DE" />
        <Columns>
            <asp:TemplateField HeaderText="FeesName" SortExpression="Name">
                            <ItemTemplate>
                    <asp:Label ID="lblname" runat="server"  Text=''<%# Bind("feesname") %>''></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
           <asp:TemplateField HeaderText="FeesAmount" SortExpression="Name">
                           <ItemTemplate>
                    <asp:TextBox ID="txtName" runat="server" ></asp:TextBox>
                </ItemTemplate>
             </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#CCCC99" />
        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>



请谁能帮助我解决此问题.

谢谢.



Please can anyone help me to resolve this problem.

Thanks.

推荐答案

<asp:textbox id="txtName" runat="server" xmlns:asp="#unknown"></asp:textbox>



您是否尝试将TextBox字段绑定到数据库?.



Did you tried to bind TextBox field to the database ?.


这篇关于用于GridView控制的Gridview-数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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