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 August 5th, 2003, 10:06 AM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to DreamKid
Default Displaying Info. from MS Access

After connecting asp.net with ms access..

dim dbconn, sql , dbcomm, dbread
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source =" & server.mappath("PULSystem.mdb"))

dbconn.Open()

sql="SELECT * FROM Book WHERE BookID='" & id_txt.Text & "'"

dbcomm = New OleDbCommand(sql,dbconn)
dbread = dbcomm.ExecuteReader()

i would like to display a data from a field from a table into a textbox. How do i do that?

<%#Container.DataItem("BookID")%>
i did this for a table & it works fine but i can't put it into a textbox of label.
Please help me out here.. thanks!

(^.^) v
 
Old August 6th, 2003, 11:17 AM
Registered User
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try
.....
dbread = dbcomm.ExecuteReader()

If not (dbread Is Nothing) Then
  textbox_name.Text = dbread.Item("BookID")
End if
....

or

While dbread.Read()
  textbox_name.Text = dbread.Item("BookID")
End While
......

assuming you are using:
<ASP:Textbox ID="textbox_name" RUNAT="server" />

Hope this helps,
Guard-dog
 
Old August 6th, 2003, 11:03 PM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to DreamKid
Default

Thanks..
But still there is a little problem saying that the row/column does not exist..
(The column do exits!)

(^.^) v





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the format of MS Excel Cells from MS Access hewstone999 Access VBA 0 March 7th, 2008 07:19 AM
Database migration MS Access 2003 to MS SQL 2000 ayazhoda SQL Server 2000 3 April 23rd, 2007 11:38 AM
MS ACCESS 2003 FRONTEND AND MS SQL SERVER 2005 DB mohankumar0709 SQL Server 2005 3 March 23rd, 2007 12:48 AM
MS Data Grid control in ms access application roshla_p Access VBA 5 October 16th, 2006 02:37 AM
Exporting data from MS Excel sheet to Ms Access ajindal General .NET 1 January 17th, 2005 03:00 AM





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