displaying just one cell

hygor

Newcomer
Joined
Aug 19, 2004
Messages
9
Location
Manchester, UK
Right this is for one of my mates as he is doing a web based project in asp.net and all i know about is windows applics made in vb.net... so i said i would post it for him!

RecordSets!! AHHHH!!!

ASP.NEt is making me :mad: Angry

I have a database running on SQLServer, I want to display just one record from the database (just one ickle cell) and I am finding this extremely difficult!

I want the page the record is displayed on to be dynamic so that when the user has finsihed with the page and wishes to view the next page (effectively next record) the page dynamically loads the next record. I realise I will have to establish a variable to record the record number and increment it at the point the next page wishes to be loaded. I just can't get my head around the displaying just one cell thing. I can display a full table or just one column, just need to know how to show one single cell from a table and I am sorted.

Any help gladly received.

Thanks

Ralph

As you can see he is at the end of his teather and I couldnt help him... so if any of you can, it would be much appreciated!

Cheers

Hygor
 
What do u mean he cant display one cell?

You create, for example, a textbox, then do a sql and bind data in it. Have a button, when user clicks it, call the SQL again, with the next recordid and display it..

maybe I'm making it much simpler than what he wants to do..
 
eramgarden said:
What do u mean he cant display one cell?

You create, for example, a textbox, then do a sql and bind data in it. Have a button, when user clicks it, call the SQL again, with the next recordid and display it..

maybe I'm making it much simpler than what he wants to do..


Souds simple...... so how does one do this?

There doesn't seem to be any clear concise explanations out there on how the dataset / adapter / view / list / and on and on and on actually work. They are so vastly different from the old ADO recordsets which were dead easy to work with. They baffle many of us .net noobs. I still cant figure out how to do a simple record bind to a textbox control. let alone how to step through data rows in a databse updating each bound text box as I do so.

I'm sure the ADO.net process is a gem of a new solution as far as efficiency and ingenuity goes but the bloody thing is hard to use.
 
DumAsp said:
Souds simple...... so how does one do this?

There doesn't seem to be any clear concise explanations out there on how the dataset / adapter / view / list / and on and on and on actually work. They are so vastly different from the old ADO recordsets which were dead easy to work with. They baffle many of us .net noobs. I still cant figure out how to do a simple record bind to a textbox control. let alone how to step through data rows in a databse updating each bound text box as I do so.

I'm sure the ADO.net process is a gem of a new solution as far as efficiency and ingenuity goes but the bloody thing is hard to use.


Ok, so the absolute lack of response on this last post proves what? That the answer is not so simple? Still looking for an answer on this one. Any one out there that has a clear answer on this one other than 'just bind it to the data'.
 
As a rule it really helps if people post whatever thay have got at the moment or at least some information about the system they are working with.

If you have a simple control on a web page (label, textbox etc.) and a dataset then at design time you can use the properties wind to setup databinding (top option in the properties window)

If you are using code to do this then you should look at the DataBinding class in the framework. this normally entails using code similar to the following within the HTML of the page.
Code:
Text='<%# DataBinder.Eval(Container.DataItem, "UnitPrice", "{0:c}") %>'
 
Last edited:
Back
Top