This is a pretty broad question so bear with me here. I'll try to make it as understandable as possible haha. Alright, so lets imagine I have an SQL database on my web server named diary, and I have a table in the database called entries. The table has the following properties:

  • Column: entry_id (TEXT)
  • Column: entry_name (TEXT)
  • Column: entry_content (TEXT)

Now, this is what I want to do. I want to be able to fetch data from the database, and display a list of all of the database entry names so I can read entries from a list. Clicking on the entry will forward me to a new web page that will display the entry content (or the entry text) for the diary entry.

I hope I'm not making this too difficult to understand, but I actually can't find any examples on how to display database data on a web page (perhaps because I'm making this far too complicated, but hey ho)

If anybody can give me some pointers (I'm not asking for complete code snippets here; that's not how one learns) then I'll be greatly thankful. Thank you!

Recommended Answers

All 3 Replies

If you are doing this in asp.net and you have visual studio installed, you can get this done with minimal code. Sounds like a good example for using a grid view control on the first page Nd when you pass the entry ID to the second page, display the results in a simple details view control.

By the way entry_id should be stored as an integer in the database and make this the primary key.

I don't use Visual Studio for web development, purely because it's a faf to get started and it's buggy for me. I usually experience a bug 5-10 minutes into use that stops me from using the directional keys and the backspace/enter key. I'm using Notepad++ right now. I'll take a look however, and I'll also change the ID column to the primary key. Thank you!

More power to you if you can develop asp.net using notepad++. It's a pretty large framework for not using an IDE.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.