Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 April 21st, 2005, 12:00 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to edit and update my access db using asp.net

well i created a aspx page that displays content of two tables . Now i want add edit and delete buttons to same page so that it allow me edit and update the content of access db using datagrid and text box in new page. But i do not know how i can do that. I mean once i click on edit button it goes to a new page and displays the same record in edit boxes and allow me to change and submit it again.i be happy if some one show me the simplest way to do this since i am not very new to asp.net world.Thanks
here is the code i created:

<%@ 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 += "\TENNIS DATABASE.mdb;"
          strConnect += "Persist Security Info=False"

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


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

'second select


          Dim strCommand2 As String
          Dim DataSet2 As New DataSet

          strCommand2 = "SELECT * FROM PENALTIES where playerno = " +Request.QueryString("person_id")+";"
          objConnection = New OleDbConnection(strConnect)
          objCommand = New OleDbDataAdapter(strCommand2, objConnection)
          objCommand.Fill(DataSet2, "PENALTIES")
          DataGrid2.DataSource=DataSet2.Tables("PENALTIES"). DefaultView
          DataGrid2.DataBind()
end sub
</script>


<html>
<head>
<title>Data Grid Control example</title>
</head>
<body>
<asp:DataGrid id="DataGrid1" runat="server" />
<br>
<br>

<asp:DataGrid id="DataGrid2" runat="server" />

</body>
</html>



 
Old April 21st, 2005, 12:20 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

An example: http://www.superdotnet.com/Article.aspx?ArticleID=48

Brian
 
Old April 21st, 2005, 12:37 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by bmains
 An example: http://www.superdotnet.com/Article.aspx?ArticleID=48

Brian
well thank u for link but that is using c# . i never used c# and i only know vb.net!!

 
Old April 25th, 2005, 10:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

http://authors.aspalliance.com/aldot...translate.aspx

Brian
 
Old April 25th, 2005, 03:03 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by bmains
 http://authors.aspalliance.com/aldot...translate.aspx

Brian
does it convert it corectly ? should i translate the script part only?






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.Net, Access DB, and a webform? TheNinthPlayer BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 8 June 3rd, 2008 10:28 AM
Excel sheet accessing(edit/update) in asp.net hemant.dna ASP.NET 1.0 and 1.1 Basics 0 January 31st, 2007 07:37 AM
Error in Asp,net and MS Access DB shankha ADO.NET 1 January 4th, 2006 12:00 PM
ASP form to email & update Access db seala Classic ASP Basics 3 July 22nd, 2003 01:39 AM





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