C# Database Programming for Beginners | Part 1 – Creating a SQL Server Database


In this series, we’ll create a Windows Forms desktop application that reads and writes data in a SQL Server database. We’ll learn how to write select, insert, update, and delete SQL queries and how to implement those queries in a C# application.

In part 1, we set up the database for the application. We add tables and columns and define primary and foreign keys.



  1. This might sound really dumb but I need help.

    When I try to add a Service-based Database, it pops up saying that it requires LocalDB or SQL Server Express to be installed and running. I've downloaded SQL Server Express, what should I do now/how do I create a LocalDB?

    Lol sorry guys I suck, help a guy who's trying to learn out please and thank you 🙂

  2. I'm having a bit of trouble, when I have created a new Service based Database I am not getting the option to "Add Table" at 2:34 when I right click, just 'Properties' and 'Refresh'.
    Am I missing something or missed a step?

  3. dosent work

    Dim score As Integer = 0
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    label1.Text = "your score is: " & score

    End Sub
    Public Sub add(ByRef x As Integer)
    x += 1
    End Sub
    End Class

  4. Your tutorial may be one of the best one out there but your texts are so small. Please improve that in your future video. Thank you.

  5. Just Finished the series; thank you so much. I'm an iOS developer, so when I had to task to make a C# program for my OOP class, I didn't know how to work with data and this series is what I needed for my year end project.

  6. I mixed this with a login tutorial and got it working,
    thanks so much. I'm just curious if this form of databasing
    will still allow users to connect with one-another or is this local only?

  7. Why do I need to run a SQL server, if just want to have a local database, like a local table full of data (something like an excel table)?

  8. hey! when i click on tables to add a new table it dont show any option to add new table it just shows refresh and properties please help me out. thanks

  9. Great Video, but i got a question.
    When i add for example a button from the toolbox and code it than add another button why does it include the code from the first button?
    And when i delete the rest it won't run?

  10. +SeeSharpCode thank you for these videos i really don't wanna hear any indian accent and bad tutorials,channels like you are very rare :D, +1 Subscriber

  11. 2:50 starting to create tables
    2:58 name DB
    3:10 entries/design
    4:55 associative databases
    5:30 foreign key – primary key of another table
    6:00 introducing idea of foreign key usage

  12. I love this series I've learned so much in these 4 short videos. Do you ever plan to continue or can you suggest another source…

  13. This is a great tutorial series! Great for someone with C# and SQL understanding to be able to merge them together in a local database 🙂

  14. Wow, great job of covering the fundamentals with simple examples and thanks for not going painfully slow. I like the pace and the clear & concise explanations. You've earned a subscriber.

  15. First of all thanks for the tutorial! Just a question. I use visual studio 2010 and I try to follow your steps, but I'm not able to see the code that appear in the lower part of the screen ""T-SQL". In other words where appear the codde "CREATE TABLE etc." Could you explain me how I can see this part? thanks a lot

  16. very awesome tutorial…
    i grew tired of hindi accent…
    just a piece of advice… if you want to teach coding and use code editors and stuff… PLEASE make the font big…


Please enter your comment!
Please enter your name here