Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2005, 07:04 AM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to add saving feture to this asp.net form

Hi Experts.I am new to asp.net and i need help in how to add saving feture to this code. either in same page or next page with confirmation by clicking the update all button.I be happy if some one show me show me how i can update a single row .Thanks



<%@ Page enableViewState="False" Language="VB" debug="true"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OLEDB" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>



<script language="vb" runat="server">
Sub Page_Load(Sender As Object, E as EventArgs)
         Dim objConnection As OleDbConnection
         Dim objCommand As OleDbDataAdapter
         Dim strConnect As String
         Dim strCommand As String
         Dim DataSet1 As New DataSet

         strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
         strConnect += "Data Source=C:\Inetpub\wwwroot\"
         strConnect += "db\"
         strConnect += "\db.mdb;"
         strConnect += "Persist Security Info=False"

         Response.Write("Viewing Player Record No:" +Request.QueryString("person_id")+"")


         strCommand = "SELECT * FROM PENALTIES where playerno = " +Request.QueryString("person_id")+";"
         objConnection = New OleDbConnection(strConnect)
         objCommand = New OleDbDataAdapter(strCommand, objConnection)
         objCommand.Fill(DataSet1, "players")
         DataGrid1.DataSource=DataSet1.Tables("players" ).DefaultView
         DataGrid1.DataBind()

'second select


end sub



</script>


<html>
<head>
<title>Data Grid Control example</title>
</head>
<body>



<form runat="server">
<asp:label id="lblUpdateResults" Font-Bold="True" runat="server" />
<p>

<asp:datagrid id="DataGrid1" runat="server"
     AutoGenerateColumns="False"
     HeaderStyle-HorizontalAlign="Center"
     HeaderStyle-BackColor="Red"
     HeaderStyle-ForeColor="White"
     HeaderStyle-Font-Bold="True"
     HeaderStyle-Font-Name="Verdana"
     AlternatingItemStyle-BackColor="#dddddd"
     ItemStyle-Font-Name="Verdana"

     DataKeyField="PLAYERNO">




    <Columns>
    

    

     <asp:TemplateColumn HeaderText="PAYMENTNO">
        <ItemTemplate>
         <asp:TextBox runat="server" id="PAYMENTNO"
             Text='<%# Container.DataItem("PAYMENTNO") %>' />
        </ItemTemplate>
     </asp:TemplateColumn>

<asp:BoundColumn DataField="PLAYERNO" ItemStyle-Width="10%"
             ItemStyle-HorizontalAlign="Center" HeaderText="Playerno" />

     <asp:TemplateColumn HeaderText="PEN_DATE">
        <ItemTemplate>
         <asp:TextBox runat="server" id="PEN_DATE"
             Text='<%# Container.DataItem("PEN_DATE") %>' />
        </ItemTemplate>
     </asp:TemplateColumn>

     <asp:TemplateColumn HeaderText="AMOUNT">
        <ItemTemplate>
         <asp:TextBox runat="server" id="AMOUNT"
             Text='<%# Container.DataItem("AMOUNT") %>' />
        </ItemTemplate>
     </asp:TemplateColumn>





<asp:EditCommandColumn
            HeaderText = "Update All"
            EditText = "Update"
            CancelText = "Cancel"
            UpdateText = "Update"

        />

</Columns>
</asp:datagrid>




</form>

<br>



</body>
</html>
 
Old May 7th, 2005, 03:29 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you can find some code related to this at

A complete Editable Data Grid in ASP.NET 1.1
http://prashantprof.blogspot.com/
Its a single page version and not the complete code so you will have to insert the some basic tags & import.





Similar Threads
Thread Thread Starter Forum Replies Last Post
saving xml in asp.net using schema kavifs ASP.NET 1.0 and 1.1 Professional 0 February 23rd, 2007 10:32 AM
Saving Images in SQL database using VB ASP.Net louie001 ASP.NET 1.0 and 1.1 Basics 1 November 24th, 2005 04:05 PM
Add asp.net page to asp project debdemoe Classic ASP Basics 0 August 17th, 2005 12:28 PM
how to add more than one form in asp.net alyeng2000 ASP.NET 1.0 and 1.1 Professional 2 July 19th, 2004 02:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.