Hi guys, I'm quite unsure of what i'm doing here and could use some guidance. I've searched but haven't found any links that were focused enough. My objective is to connect my application to a database for the first time. I've never done this before so it's essentially a learning exercise.

Within visual studio i've followed the "Connect to database" in the Tools tab and followed the connection wizard. My understanding is i need to connect to my local sql server (this may be incorrect) and i cant find it. I'm not sure how to even get started, what do i need to download in order to create a database on my laptop? i guessed my sql, but i'm not sure what would be recommended -

http://dev.mysql.com/downloads/mysql/

Where do i go from here?

Dani AI

Generated

A short, practical summary that builds on the replies from , and — without repeating the exact steps already posted.

A few sensible starter choices (goal-driven): for quick Windows development and best Visual Studio integration, use SQL Server LocalDB (lightweight developer instance of SQL Server). (learn.microsoft.com)
For the simplest zero‑admin, file‑based workflow (good for learning schema and queries), use SQLite. (sqlite.org)
If the project is intended to run on Linux or in a production-like environment, prefer a full server such as PostgreSQL (strong, cross‑platform) rather than treating the local test DB as the production DB. (postgresql.org)

Key .NET tooling and libraries to plan for: use the modern SQL client package Microsoft.Data.SqlClient for SQL Server access, not the older System.Data.SqlClient. ()
For data access patterns, Entity Framework Core is the mainstream cross‑provider ORM; Dapper is a lightweight, very fast micro‑ORM if direct SQL is preferable. (learn.microsoft.com)
For PostgreSQL, use the Npgsql ADO.NET provider (EF Core has a provider for PostgreSQL as well). (npgsql.org)

A compact learning workflow and checklist (apply in order):

  • pick the engine that matches the final deployment target (LocalDB or SQLite to learn fast; Postgres for cross‑platform).
  • install the server or put the DB file in a known folder and confirm a client can open it (use a GUI or psql/sqlite3).
  • add the appropriate NuGet provider (Microsoft.Data.SqlClient, Npgsql, or the SQLite provider), then open a minimal VB.NET console or form project and test a single connection + simple SELECT.
  • once the simple connection works, experiment with parameterized commands, transactions, and an ORM (EF Core or Dapper).
    Common failures (service down, wrong server/instance name, firewall/port, missing provider or bitness mismatch) are covered in Microsoft’s connection troubleshooting guidance. (learn.microsoft.com)

Example VB.NET test (very small, just to get a connection open):

Imports Microsoft.Data.SqlClient

Dim cs As String = "Server=(localdb)\MSSQLLocalDB;Integrated Security=True;Database=master"
Using cn As New SqlConnection(cs)
    cn.Open()
    ' run a tiny test query here
End Using

This complements ’s Visual Studio integration comment and ’s server suggestion by showing which engines and drivers make the initial setup least painful while leaving a clear upgrade path toward production databases and modern .NET libraries.

Recommended Answers

All 4 Replies

I am guessing you have already downloaded and install mysql on your computer. If you want to just display/access your database from Microsoft Visual Studio you can do the following steps:

1) Click on view, scroll to server explorer and click that. (Alt/shortcut: Press ctrl+w+l together to get it to open)
2) Right click your data connection and select add connection.
3) Change your datasource to mysql and just follow the wizard,

It is that easy. Though I doubt many industry will be using mysql these days,

Thanks, where i'm quite unsure is basically everything before the actual starting to code with vb.net using the database. What do you reccomend i dl and use as a database if not mysql? (haven't dled anything yet).

You have SQL Server 2012 Express (Free from Microsoft's Website)

You have Oracle(Some free versions, haven't worked with.)

Microsoft works well with SQL Server so that and it is mostly used in industry. The express version is has limited function but if you are just using for learning purpose I think it would surffice. If you are planning to learn linq to sql which only work with Microsoft SQL Server then your only choice is Microsoft SQL Server. However, linq to sql will be removed in favor of entity framework which work better than linq to sql and does not have the databse restriction.

Those database mention by Begginnerdev are alright so does MySql. Whichever you choose, choose one that you are comfortable with.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.