<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource3"
Width="950px">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="B_SLIPNO"
DataTextField="B_SLIPNO" HeaderText="Print" DataNavigateUrlFormatString="PRINT_CASH_CREDIT_SLIP.aspx?dt={0}" NavigateUrl="~/PRINT_CASH_CREDIT_SLIP.aspx" >
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:HyperLinkField>
<asp:BoundField DataField="B_BRANCH" HeaderText="Slip No" SortExpression="B_BRANCH">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="B_SLIPNO" HeaderText="No" SortExpression="B_SLIPNO">
<HeaderStyle Width="35px" CssClass="hideHeader" />
<ItemStyle CssClass="hideGridColumn" />
</asp:BoundField>
<asp:BoundField DataField="B_DATE" HeaderText="Date" SortExpression="B_DATE" DataFormatString="{0:dd/MM/yyyy}" >
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="OBK_NAME" HeaderText="Bank" SortExpression="OBK_NAME" >
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="B_AMOUNT" HeaderText="Amount" SortExpression="B_AMOUNT" DataFormatString="{0:N}">
<HeaderStyle Width="90px" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:TemplateField HeaderText="Bank Date">
<ItemTemplate>
<asp:TextBox ID="TextDate" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextDate" PopupButtonID="TextDate" CssClass="cal_Theme1">
</cc1:CalendarExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowSelectButton="True" SelectText="OK" />
</Columns>
<HeaderStyle BackColor="Brown" CssClass="GridViewHeaderStyle" />
<AlternatingRowStyle BackColor="RosyBrown" />
</asp:GridView>
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:FINANCEConnectionString %>"
SelectCommand="SELECT BANK_SUM.B_SLIPNO, BANK_SUM.B_BRANCH, BANK_SUM.B_AMOUNT, BANK_SUM.B_BANK,BANK_SUM.B_DATE, BANKACC.OBK_NAME FROM BANK_SUM INNER JOIN BANKACC ON BANK_SUM.B_BANK = BANKACC.OBK_CODE WHERE (BANK_SUM.B_BRANCH = @BC) AND (BANK_SUM.B_DATE between '4/19/2012' and @BD)AND (B_STA='N') ORDER BY BANK_SUM.B_SLIPNO">
<SelectParameters>
<asp:ControlParameter ControlID="TextBox4" Name="BC" PropertyName="Text" />
<asp:ControlParameter ControlID="TextBox3" Name="BD" PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
This is my gridview............
Actually i want to update my one of table.....
this is my coading
Dim DateVal As String = CType(Gridview1.FooterRow.FindControl("TextDate"),TextBox).Text
Using cons As SqlConnection = New SqlConnection(GetConnectionString)
Using cmds As SqlCommand = New SqlCommand
cmds.Connection = cons
cmds.CommandType = CommandType.Text
cmds.CommandText = "UPDATE CASHBOOK SET CA_BANK_DAT = '" + CDate(DateVal ) + "' WHERE(CA_REF = '" & mCNO & "')"
cons.Open()
cmds.ExecuteNonQuery()
cons.Close()
' Response.Redirect(Request.Url.AbsoluteUri)
End Using
End Using
I attached screen shots.
Rathnayake
Nuwan, if this helps please login to Mark As Answer. | Alert Moderator