How to output a record in to a form text box ?

liunx

Guest
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("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>
 
Top