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

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


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:

http://www.Quack-Ware.com

FORUMS

http://www.Quack-Ware.com/forums/

FREE CODE SNIPPETS

http://www.freecodesnippets.com
Closed Caption:

hey guys i got a few requests to create
tutorial on how to connect to a MySQL or
sequel or whatever i say i'm going to
interchange this grill and sequel many
times so a database i'm just going to do
it through a console application rather
than through an asp.net web page which
is what most people probably do in order
to do this you would need to set remote
diba remote access to true in your
database otherwise you'd have to run on
on the actual server but anyway to the
easy stuff i'm gonna start out with my
school the escrow one's going to be in a
different tutorial so just look on my
youtube page or whatever the first thing
we're induced we need the dll reference
to actually be able to use some of the
methods that someone's already nicely
created for us thankfully so we're gonna
go to this site the high school website
i look at this pause the movie pause the
video copy the stand I don't know how to
Google you lots of people but i would
need to download dl for that which is
somewhere
yeah it's an exe which probably just
extracts extracts somewhere but uh
alright once you have that just click
right click references click add
reference get this is code that data
that DOL ok make sure it's added good at
using statement
two is about it .
alrighty we are good to go
alright first thing we're going to do is
we're going to build our connection
string that's basically going to contain
all of our information like our server
name report or database or user ID and
your password and this will vary based
on your hosting provider and whatever
you've entered in my server is very long
so we go and went oh yeah and all this
information is going to be void as soon
as this is released make sure that you
guys messed my shit
and if you do I don't really care about
I could keep it up just to see us could
experiment with it but I'd rather not
all right there is our strength now we
have to create a myschool connection
providing at the connection string we
have to create a myschool command
and we get that using the conduct crete
command and then we have to set the text
this is the actual query gonna do for
this i'm just going to do a a select
statement a insert statement and an
update statement those are probably
through the most basic ones and you can
look up more and look up how to do that
but uh alright we're going to start out
with is select so let's go take a look
at the database
all right i got this table called
tutorial table got these three rows or
two columns 3 rows and she won and you
know so we're just going to want to grab
the text from let's say the second one
that says low this is second is the
sport i did this
ok so we're just going to select text
from tutorial table where equals two
oops
kick and this will select the this
column value when this column ID equals
2 which is this such selected low this
second and we're going to open up the
connection
Scott been probably a good idea to put
this in a try-catch block you're messing
with things that will most likely died
sometime
yeah
yeah
ok
now we're going to create my skill data
reader will read the data this is
usually an East for select statements as
far as i know my school data reader or
equals command execute reader and while
we can read data we are going to write
the data to console and since we want to
select the data in the text column we're
going to do read a record reader bracket
text and bracket to string and at the
end of this we're just going to put a
console that read on
so you actually read it and it should be
able to do that
look there we go and let's change it to
one
we go back century 21
three
cool what happens when you do for just
see what happens
yeah i think just nothing happened what
happens when we do this
nope makeup area angry Attis very very
angry
so this is why you want to strike
catches their ok there's select
statement very very simple now for its
to insert statement just comment this
out right we're going to come with us up
to
it's a little bit different got the sit
command text and we're going to insert
into tutorial table and we have to
provide it the names of the comp columns
that want to insert into which is at
this point in idea text and then the
values and make sure you do a single
quote mark or else it will interpret it
as a column name and we do not want that
we wanted to interpret this data so
it makes no sense in English but
whatever
I don't know why I did that here
ok so insert into tutorial table the in
the columns ID and text values for and
this is for theta and in order to do
this we're going to conduct open
oh and i think i forgot to mention once
you're finished always make sure you
close the connection where you con . x
nothing gets who are not now okay
right
yeah

Video Length: 08:01
Uploaded By: QuackWare
View Count: 329,902

Related Software Products
VISUAL C# 2005 AND DATABASES
VISUAL C# 2005 AND DATABASES

Published By:
KIDware

Description:
VISUAL C# 2005 AND DATABASES is a tutorial that provides a detailed introduction to using Visual C# for accessing and maintaining databases for desktop applications. Topics covered include: database structure, database design, Visual C# 2005 project building, ADO .NET data objects (connection, data adapter, command, data table), data bound controls, proper interface design, structured query language (SQL), and database reports. Actual projects developed include a sales invoice system, a home ...


Related Videos
C# Tutorial 6:  Insert/Save data to database
C# Tutorial 6: Insert/Save data to database

How to: Insert New Records into a Database Database Access with Visual C#.NET sql server - Insert Data into database in C# How to insert Data to Ms SQL server 2008 using C#.net .net - C# insert data into SQL table Using Visual C# and SQL cannot insert data into table..‎ c# import data from text file into sql databse line by line‎ store xml in SQL Server 2008 from C# Using SQL in C# - Cannot insert data into SQL table visual C# - Could not Insert ...
Video Length: 13:48
Uploaded By: ProgrammingKnowledge
View Count: 229,941

C# MS Access Database Tutorial 2 # Create Login Form with Microsoft  Access Database
C# MS Access Database Tutorial 2 # Create Login Form with Microsoft Access Database

Login Program for C# with MS Access Database Access Login Database - Microsoft Access How To Make A MS Access Login Form How to create login form in Microsoft Access 2010, 2007 Visual C# - Login Form Tutorial Microsoft Access c# - How can I close a login form and show the main form Login Form using C# and SQL Microsoft Access C# Login Form with MS Access Login Form using c# and ms access as database..?‎ closing Login form after a successful ...
Video Length: 24:20
Uploaded By: ProgrammingKnowledge
View Count: 95,174

Form Login Visual C# Connect to a Database  SQL Server Part 1
Form Login Visual C# Connect to a Database SQL Server Part 1

Connecting to a SQL Server Express Database with C# .NET Login With Combobox
Video Length: 09:13
Uploaded By: Truong Quoc Tuan
View Count: 74,135

C# MS Access Database Tutorial 6 # Insert/Save data to database
C# MS Access Database Tutorial 6 # Insert/Save data to database

How to: Insert New Records into a Database Database Access with Visual C#.NET sql server - Insert Data into database in C# How to insert Data to Ms SQL server 2008 using C#.net .net - C# insert data into SQL table MS Access Using Visual C# and SQL cannot insert data into table..‎ c# import data from text file into sql databse line by line‎ store xml in SQL Server 2008 from C# MS Access Using SQL in C# - Cannot insert data into SQL table visual C# - ...
Video Length: 18:32
Uploaded By: ProgrammingKnowledge
View Count: 70,981

How to Connect to Database using C#.net sqlserver 2005
How to Connect to Database using C#.net sqlserver 2005

Using Visual Studio connect to database (sql server 2005)
Video Length: 13:04
Uploaded By: Targetj Solutions
View Count: 1,140

Copyright © 2025, Ivertech. All rights reserved.