Tutorial Details
- Difficulty: Intermediate
- Length: 35 Minutes
Part four of this series changes the lesson plan again! This lesson introduces you to Microsoft SQL Server 2008 and SQL Management Studio. Youíll learn how to create a database, add tables to it, and populate it with data. You’ll then use that data and bind it to a template control.
Lesson 4: SQL Server
Sell ASP.NET Components on CodeCanyon
Did you know that you can sell your ASP.NET scripts and components on CodeCanyon? Simply sign-up for a free author account, and start selling!
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for the best web development tutorials on the web.



RoyalSlider – Touch-Enable ... only $12.00 
really cool, i hope to learn so much from this video
Great job explaining this I see a lot of folks struggle on how best to present data in .NET apps.
Really awesome video, just like any others in this course… Do you know when we can expect the next one? I’m hungry for more :)
Excellent tutorial! I do miss the power of data binding controls in .Net (mostly a Unix shop these days.) Very clear and concise. Especially for programmers who may never have used VS before. Great job!
Wow
That’s cool
Thanks
really cool, i hope to learn so much from this video
I want on this video Microsoft .NET blue wallpaper :)
Where can i find it ?
I made it for the series. I’ll see if I can locate the PSD.
I found it and uploaded it to http://www.wdonline.com/dotnet_wp.zip. It’s 1024×768, but it’s easy enough to make for a higher resolution.
I’ve come from VB to classic ASP, and now these days I dabble with MySQL and PHP for anything database related – the sole reason is because I was missing this exact video lol.
Brilliant. Really looking forward to the the rest in the series – can we have some classic database interactions for us geeks!!! ???
Straight-up ADO.NET was originally planned for this lesson. I don’t think we’ll see plain ‘ol ADO.NET in this series, but there will probably be an article on it sometime.
Good stuff for people new to ASP.NET/SQL Server. Just a few really small points:
1) sa is an acronym for Server Administrator (not super admin, as you say.)
2) I’m surprised you didn’t wrap your Page_Load code in
if( !Page.IsPostBack).
3) I’m glad you used those literal controls – lots of people I have worked with use asp:Label (which generates an often unnecessary span tag if the AssociatedControlID attribute is not set.)
4) The ItemDataBound method is a method, true, but more specifically, it’s an event handler.
5) I often use the ItemDataBound to do simple class hooking onto the alternate row (rather than copying and pasting the ItemTemplate markup, I can get away with not using the other template. This is especially useful if the markup is complicated (and the row/alternate row differ only by a class name.)
6) In your ItemDataBound event, your two literals will only be NOT null in an item or alternating item row. A more usual check often precedes your code, using the RepeaterItemEventArgs argument:
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
// do what’s needed with the literals in here:
}
Overall, though – good to see ASP.NET stuff on here.
Thanks, Shane. To address your points:
1. I’ve never found the official name for sa. I’ve seen it referred to as System Admin, Server Admin, and Super Admin. I use super admin as a holdover from my MySQL days.
2. No need to in this example.
3. I see that often, too.
4. It can go either way depending on your point of view. To me, it’s first and foremost a member of the _Default class. It couldn’t handle any event if the method didn’t exist within a class first.
5. I typically shy away from doing that. If I have to revisit the app a few months down the road, or if a coworker has to look at it to fix a bug, I think it’s easier for the maintainer to get a grasp of what’s going on if the templates are used the code-behind just feeds the data to the control. That’s just my preference, though.
6. That is a better way, especially if a server control with the same name and type were used in the header, footer, orseparator templates. The way presented in the video would result in a NullReferenceException if a Literal control with the name ltlLastName was in a non-Item template.
Thanks for the response Jeremy. You’re right about point 2 – I suppose I do data-binding so often in that conditional, I would always put it there anyway (though yes, you don’t need it in this example since you’re not doing any postbacks.)
Point 4 – sure, it’s a member of the _Default class, but it’s also an event handler, for that event, on that repeater. :)
Point 5 – Sure – everybody has their own way of doing things – I often put a server-side comment in the markup to alert me or somebody else that there’s some jiggery-pokery going on in the code-behind (for the reason you mention.)
Point 6. I often put that check in, since it alerts other people working on the code that I’m only expecting to find those controls in that specific row item type.
Good job. I hope 2 learn so much :)
Great article, thanks.
Nice job!!!
Hope to see more .net and sql server screen casts.
Very useful. Plenty of corporate firms use ASP.NET and tutorials like these can help to broaden the skill set for people looking to learn.
How come this video is not on iTunes?
thanks for the tut
Thanks for providing such a great and helpful information and video for asp.net and sqlserver.
In example 3, if you really wanted showcase “separation of concerns” you could subscribe to the ItemDataBound event in the code-behind:
protected void Page_Init(object sender, EventArgs e)
{
rptNames.ItemDataBound += new RepeaterItemEventHandler(rptNames_ItemDataBound);
}
I like to keep all my events in the code-behind, especially if there are buttons, data binding events, selected index changes etc..
T-SQL RowNumber() vs Rank() vs DenseRank() vs NTILE() | SQL Lion
SQL Server comes with some magical words that make simple the life of a developer or DBA to a great extent. And these magic words are RowNumber(), Rank(), DenseRank() and NTile(). Follow the link to get more…
http://www.sqllion.com/2010/07/ranking-functions/
Hello!
Just to say this video is broken.
Please fix the video
Please can you host the .mov version of this? I’ve checked the site / the members site and itunes but can’t find it. Any chance of throwing up a link?
Cheers
Stefan
unable to view this video (ASP.NET from Scratch: SQL Server).
It is saying Sorry, Unable to play this episode…
Please i want see this episode.
hello all,
To learn .net what basic languages i should learn before i start.
Very Good Screen cast.