Connect to MySQL Database - Use Select, Insert, Update - C# C Sharp Visual Studio 2010

preview_player
Показать описание
In this tutorial I show you how to connect to a mySQL database using C# and Visual Studio 2010. I also show you a few useful queries you can run: Select, Insert, and Update in order to use the data in the mySQL database.

WEBSITE:

FORUMS

FREE CODE SNIPPETS

Рекомендации по теме
Комментарии
Автор

After reding many tutorials and how to's, I finally found a solution that works. Thank you.

thieberson
Автор

I tried to Update my database but I had few problems with it. And now, after one hour of wasting time to find a solution, I came here and found out that I missed the basics :D

thanks

MediKiller
Автор

At LAST THE VERY BASIC YET IMPORTANT PART OF LEARING MYSQL

theera-thekunlimited
Автор

This actually helped me out quite a bit. I coded in VB.NET before and a little java but I had no idea how to approach this in C# but thanks to this guy I can run tons of query's and get data etc (It is practically the same as vb.net if anyone knows that.). People should stop whining about this.

LeCoffeeStain
Автор

Straight to the point. Thanks, vid was a huge help.

connerallen
Автор

Gracias Amigo, llevo una materia llamada Redes Industriales.... el profe hizo una conexión con una base de no le entendi muy a ti te entendi muy bien....gracias por el aporte....

I'm learning English and I understood everything you said. 
Thank so much

Vatrochok
Автор

Good job! Simple, easy, and to the point.

RVLiving
Автор

hundred times thanks for uploading the video

SuperRaman
Автор

How can i find my server?in2:49
I use my server in SQL but it doesn't connect.
Please help me.

reyhaneiranmanesh
Автор

For anyone still wondering how to use with winforms
i use xampp with phpmyadmin
using MySql.Data.MySqlClient;
namespace Project
{
public partial class Form1 : Form
{
//Veriables
string connString =
public MySqlConnection conn;
       
public Form1()
{
InitializeComponent();
}
       
//post username and password to database
private void button1_Click(object sender, EventArgs e)
{
conn = new MySqlConnection(connString);
{
               
 
conn.Open();
SET.ExecuteNonQuery();
conn.Close();
}
}
// Update/edit username and password to database
private void button2_Click(object sender, EventArgs e)
{
conn = new MySqlConnection(connString);
{
// you need to enter the old username & Id not very fancy but yeah
// remove the @oldusername if you want
conn.Open();
SET.ExecuteNonQuery();
conn.Close();
}
}
}
}

devell
Автор

This tutorial was great, help out alot with my project.

Xershade
Автор

Thank you very much for this video. You saved me a lot of time. Subbed.

Textra
Автор

Thank you very much for this tutorial. You saved my project. Dont pay attention to these whiners who know nothing about connecting to database with C#. What you tought here is more than enough.

arifmay
Автор

Where did you get the ConnectionString from?  You jusr typed it in without explaining it.

leavethematrix
Автор

Can someone help me I am getting this message all the time "Could not load file or assembly 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, The system cannot find the file specified.
"

ivan.Andreev
Автор

Thank you very much, this helped me a lot.

User
Автор

Thank you! You really solved my problem .. :)

banujan.b
Автор

This is perfect!! Thanks for making this tutorial and video :-)

kanetheheatsink
Автор

It seems like my code stops executing after conn.open(); If i before the conn.open(). it shows the string, if I CW something anywhere (in catch or in while(reader.Read())) it doesn't show anything. No exceptions are thrown.

EDIT: You don't need to enter the port number if you're connecting with localhost

MrQwerty
Автор

i created a sql server on my own pc. now i want a friend to be able to connect to it and get data from it. my line goes like this


but in localhost only i can connect right? and when i put my public ip in there, i cant and he cant connect.. how can i have it that all the guys that have my programm, can connect to my mysql server??

Matthew.