ASP.NET from Scratch: SQL Server
videos

ASP.NET from Scratch: SQL Server

Tutorial Details
  • Difficulty: Intermediate
  • Length: 35 Minutes
This entry is part 4 of 10 in the ASP.NET from Scratch Session
« PreviousNext »

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!

Add Comment

Discussion 29 Comments

  1. xRommelx says:

    really cool, i hope to learn so much from this video

  2. er says:

    Great job explaining this I see a lot of folks struggle on how best to present data in .NET apps.

  3. Nick says:

    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 :)

  4. Bretticus says:

    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!

  5. Wow

    That’s cool

    Thanks

  6. piyanistll says:

    really cool, i hope to learn so much from this video

  7. I want on this video Microsoft .NET blue wallpaper :)

    Where can i find it ?

  8. Jeff Adams says:

    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!!! ???

    • Author

      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.

  9. Shane says:

    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.

    • Author

      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.

      • Shane says:

        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.

  10. Irene says:

    Good job. I hope 2 learn so much :)

  11. Alan says:

    Great article, thanks.

  12. Norm says:

    Nice job!!!

    Hope to see more .net and sql server screen casts.

  13. David says:

    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.

  14. Sunny says:

    How come this video is not on iTunes?

  15. Norm Evans says:

    Thanks for providing such a great and helpful information and video for asp.net and sqlserver.

  16. Neil says:

    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..

  17. SQL Lion says:

    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/

  18. RCDMK says:

    Hello!
    Just to say this video is broken.

  19. Black says:

    Please fix the video

  20. stefan24 says:

    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

  21. Vicky says:

    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.

  22. sandy says:

    hello all,

    To learn .net what basic languages i should learn before i start.

  23. Vasanth says:

    Very Good Screen cast.

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.