Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 5th, 2007, 12:18 PM
Authorized User
 
Join Date: Jan 2007
Location: Burnley, Lancashire, United Kingdom.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to iPagan
Default Databinding asp.net help

I want to output a <h1> tag with a piece of data from a database table

Firstly my page does this:-
1: receives post from links.aspx, opens connection to a database then pulls data and populates a grid DONE that bit that was rather easy.

2: opens a connection (SqlDataSource2) and gets the following "select UID, LinkArea, FriendlyName from where @uid wtb_cat" Now what I want to be able to do is write a H1 tag from that, in the good olde days I'd have done something like <%=FriendlyName%> I've looked through a ton of books and can't find the code I am looking for, can anyone help?

--

404 real life user not found
__________________
--

404 real life user not found
Reply With Quote
  #2 (permalink)  
Old February 5th, 2007, 12:24 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

...Are you trying to add the H1 tags in the datagrid or are you simply trying to write the data out to the browser surrounded by an H1 tag?



================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Reply With Quote
  #3 (permalink)  
Old February 5th, 2007, 01:36 PM
Authorized User
 
Join Date: Jan 2007
Location: Burnley, Lancashire, United Kingdom.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to iPagan
Default

I am trying to get at the data and write it into a <h1> outside the datagrid

Data grids can be useful but in this case not really :S

--

404 real life user not found
Reply With Quote
  #4 (permalink)  
Old February 5th, 2007, 02:09 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What are you returning the data into? A dataset, datatable, datareader?

In all of the cases, getting to your data will be something similiar to

Response.Write("<h1>" + Convert.ToString(datatable.rows[0]["FriendlyName"]) + "</h1>");
Response.Write("<h1>" + Convert.ToString(datareader["FriendlyName"]) + "</h1>");
Response.Write("<h1>" + Convert.ToString(dataset.tables[0].rows[0]["FriendlyName"]) + "</h1>");



================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Reply With Quote
  #5 (permalink)  
Old February 6th, 2007, 08:50 AM
Authorized User
 
Join Date: Jan 2007
Location: Burnley, Lancashire, United Kingdom.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to iPagan
Default

Alright, thanks for that, whilst looking at that code I assume, that in this instance we are using a datatable which is populated on page load.

So I've had a look through the books I already have and help files, and am still missing some of the point on the datatable bit, so i've just ordered the WroxBox (asp.net version) Thanks for your help anyway.

--

404 real life user not found
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning a regular ASP.NET App into an AJAX ASP.Net donrafeal7 Ajax 2 August 31st, 2007 12:33 AM
.net 2.0 - databinding to GUI in multi-threaded ap ivj C# 0 September 7th, 2006 01:49 AM
asp.net DataBinding wigmo XML 0 July 24th, 2003 12:22 PM



All times are GMT -4. The time now is 08:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.