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 3rd, 2005, 08:23 AM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to output a record in to a form text box ?

How to output a record in to a form text boxes for update purpuse(just linke online editing).This is my code that displays 2 diffrent records from two diffrient tables.

this part prints out record from fist table
<asp:DataGrid id="DataGrid1" runat="server" />
and

This part prints out record from second table
<asp:DataGrid id="DataGrid2" runat="server" />

I want the record fields to be printed
in two seperate form text boxes for purpuse of updateing and then submitting it back to db. I be happy if some help me medify this code
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 += "\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" ).DefaultView
         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("PENALTIE S").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 May 4th, 2005, 01:10 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

you can use template columns for editing the records in a datagrid

Regards
Ganesh
 
Old May 4th, 2005, 01:11 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default


You can use template columns with textboxs in the grid(just convert the boud column to a template column)

Prashant









Similar Threads
Thread Thread Starter Forum Replies Last Post
Get last record and display in an Text Box hewstone999 Access VBA 1 March 18th, 2008 06:48 AM
How to clear all text box in a form at once time richie86 ASP.NET 1.0 and 1.1 Basics 1 October 31st, 2005 04:57 AM
Reset text box value on new record aware Access 3 October 24th, 2005 02:13 PM
record the time a text box is updated techsp Access 2 August 2nd, 2005 09:51 AM
Setting Focus on a Text Box in a Web Form vbmazza VB.NET 1 May 4th, 2005 09:19 AM





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