Looking for a good example of a database web app

ikantspelwurdz

Well-known member
Joined
Dec 8, 2009
Messages
49
Programming Experience
1-3
I'm trying to teach myself how to do stuff in ASP.NET, and I find I learn things best by looking at projects other people have already done, taking them apart, and seeing if I can re-create it.

Specifically, what I'm looking for right now is a web form that connects to a locally-run SQL Server database. It displays all of the main records in a table and allows you to select one of them. When selected, you are given a form which represents the selected record, and with which you can view and/or update the selected record. Bonus points if the web app has a login form and allows users to have differing permissions, but not strictly necessary. What's more important is that the app is made using good habits, so I won't learn bad habits from studying it, like using outdated controls.

Anything out there I can download and play around with?

To recap with pictures, I want to make a grid with a list of all records, but not all fields. It would look something like this, except on a web form:
gridview.PNG

And when you select one, I want the new page to show *all* of the fields, but just for that selected record, and it should look something like this:
updateform.PNG
 
Last edited:
Sadly, this is not as simple as you would think it could be. There are a lot of technology choices you have to make. Do you want to use the new Razor syntax or the ASP.NET .ASPX markup syntax? Will you use Linq-To-SQL or the Entity framework (to name only two of the many choices)?

Microsoft used to have starter kits which are complete projects, but those apps are now kind of obsolete, or at least using last years technology. Here's a link just in case: Archived Downloads v1.1 : Official Microsoft Site

Here's a place that can help you make the technology decisions as well as some good tutorials and videos: Get Started with ASP.NET & ASP.NET MVC : Official Microsoft Site
 
From viewing the video on that site, ASP.NET Web Forms is definitely the way to go for me. I'm most comfortable with WinForms, and I've never much liked traditional HTML web development.

Entity *seems* like it's the right way to go, but I have no proof of this, and I don't completely get how it works either. The tutorial on how to use it, the one with ContosoUniversity, looks like a decent model, but it is set up so that the user can edit and update the data directly from a GridView, and I'm struggling to figure out how to change it so that instead you get a clipboard-like view of the selected record.

I'll post what I've got so far later today. I've got a page "Students.aspx" which displays abbreviated student records in a GridView and has Select buttons that don't do anything. And I've got a page "Student.aspx" which displays the extended record of the student with ID=0 in a ListView. The ListView is editable, but I haven't figured out how to make updating work yet - right now it throws an exception about not having an update command. I am trying to determine:
1: How do I make it so you can click on an abbreviated record and then redirect to Student.aspx with that selected record?
2: Is ListView the best control for this? Suppose the Student record had 100 fields and I wanted a form with all of them, and easily arrangeable. Is there a better control for that than ListView?
3: How do I make updating it work?
 
Last edited:
...and I just learned that it's bad to have a page called "Student" when you also have a DAL class called "Student." Here's what I've got, with the limitations and reservations from the post above.
 

Attachments

  • ContosoUniversity.zip
    548.6 KB · Views: 29
From viewing the video on that site, ASP.NET Web Forms is definitely the way to go for me. I'm most comfortable with WinForms, and I've never much liked traditional HTML web development.

Entity *seems* like it's the right way to go, but I have no proof of this, and I don't completely get how it works either. The tutorial on how to use it, the one with ContosoUniversity, looks like a decent model, but it is set up so that the user can edit and update the data directly from a GridView, and I'm struggling to figure out how to change it so that instead you get a clipboard-like view of the selected record.

I'll post what I've got so far later today. I've got a page "Students.aspx" which displays abbreviated student records in a GridView and has Select buttons that don't do anything. And I've got a page "Student.aspx" which displays the extended record of the student with ID=0 in a ListView. The ListView is editable, but I haven't figured out how to make updating work yet - right now it throws an exception about not having an update command. I am trying to determine:
1: How do I make it so you can click on an abbreviated record and then redirect to Student.aspx with that selected record?
2: Is ListView the best control for this? Suppose the Student record had 100 fields and I wanted a form with all of them, and easily arrangeable. Is there a better control for that than ListView?
3: How do I make updating it work?

1. Response.Redirect("~/Student.aspx?id=" & SelectedStudentID)
2. I like GridViews
3. Add an event handler for RowUpdating on your list/grid
 
Back
Top