如何将gridview值插入数据库
问题描述:
大家好,
我需要将gridview行值插入DB.
这是我的Gridview
Hi All,
I need to insert the gridview row values into DB.
this is my Gridview
<asp:GridView ID="GrdOptions" runat="server" AutoGenerateColumns="False"
Width="212px" ShowHeader="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txttask" runat="server" CssClass="Text" MaxLength="500"
Width="350px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txthrs" runat="server" CssClass="Text" MaxLength="500"
Width="80px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
我只需要检查每一行有多少行具有tha值,就可以只基于该行插入我的值.
在该文本框中输入值时,我需要显示第二个文本框值的汇总值.
在此先感谢
Sucharitha
i need to check the each row that how many rows have tha values based on this only i need to insert only that row has value.
I need to show the summarise value of second textbox value while i enter a value in that text box.
Thanks in advance
Sucharitha
答
您可以插入临时表,然后根据临时表中的某些条件更新主表
you can insert into a temp table and then update the main table based on some criteria in temp table