C# SQL Database Tutorial 1:How to Connect and Use Local Database ( sql server ) using C#

ProgrammingKnowledge · 964K views · 2013 · 17:31

Open on YouTube

Software (other)Databases & storageProgramming language designtutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering beginners who need a first walkthrough of connecting C# to a local SQL database.

Recommended by 2 people across 2 different months, 2014 to 2015.

What it is

A 2013 beginner tutorial from ProgrammingKnowledge showing how to connect a C# application to a local SQL Server database file (SQL Server Compact / local database) in Visual Studio. It walks through creating the database, setting up a connection and basic use from code.

What people said

Recommends Olivier Morel · 2014-05 · Stack Overflow · on “How can I go about saving the state of my panels to my DB without using PHP”

You seem a bit lost (nothing wrong about it), but since you're using C#, you should find a way in C# to access your database. PHP is just a server-side language you could use, but it means installing PHP on your server... and I don't think this is what you want/need. I'm pretty sure, there are very nice tutorials on the web on how you can interact with your current DB (what are you using? MySQL?) Basic tutorial for SQL with C# [this video]

Recommends YoryeNathan · 2015-04 · Stack Overflow · on “Most effective way of storing and managing moderate number of users”

It does. DB's are certainly faster than using a file system (textfiles etc). I recommend SQL Server because it is great as a database and fairly simple to learn and dive into. You can start here [this video] .

Cites Nino Vrijman · 2014-10 · Stack Overflow · on “Retrieving data from a single column in a local database in C#”

I'm trying to create a local database file (for a school assignment) and I've managed to get the database working (I can add new data to it etc.), the database file is in the .mdf format. There is one thing I'm getting stuck on. It's hard for me to explain how it works exactly (I recently started programming) so I will post a link to the video that I used to make my database: video here [this video] . I got it working to the point that I'm able to search for a value in a certain database column (it searches for a color). After I executed the search only one row is visible in the DataGridView. Then I have to retreive the value (in this case it is text / a string) of another column in the same row.