C# Windows Form Application Mysql Connection c# – How can I connect to MySQL from windows forms? Using Visual C# Windows Forms with MySQL C# …
Original source
C# Windows Form Application Mysql Connection c# – How can I connect to MySQL from windows forms? Using Visual C# Windows Forms with MySQL C# …
Original source
46 responses to “C# Tutorial 1:Getting Started and Mysql database Connection”
just three words ….you are awesome
hi Sir :
one problem i have in database :
how to save text(comment) and pdf file in sql to show in visual studio using c#
please help me
try this MySQL connector, it's awesome https://www.devart.com/dotconnect/mysql/
MySqlConnection conDataBase = new MySqlConnection(constring);// constring is showing error in update ,delete bottom but in insert buttom it is not showing any error
Sir, i want to add subscript and superscript string in label. how can i do it? please help me.
hello sir my visual stdio me my sql data nahi milta hai please
There is error which provide exception. So, replace first line in block 'try' by this:
String myConnection = "SERVER=localhost;UID=root;PASSWORD=root;";
Don't know if it matters, but tutorial #3 is missing (assuming it's not supposed to go from #2 to #4)
so how the database work on another PC means i build the software package, then the SQL where stored in them computer.
This caused me some errors with the syntax. Below is a link to the correct syntax:
http://stackoverflow.com/questions/31230445/windows-form-application-mysql-cannot-convert-from-string
Lis ten I cannot get that MySql.Data in the "References -> Add References" dialog! Only the MySql.Data.Entity can I get. Can someone pls help me with this?
Lisren I used your code exactly as you had typed it out but got the error msg. when I clicked the button that said "Keyword Not Supported:'datasource' " How do I fix this problem?
using System;
using MySql.Data.MySqlClient;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace MyWinFormApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
string myConn = "datasource = localhost;port = 3306; username = root; password = steve";
SqlConnection myConnection = new SqlConnection(myConn);
SqlDataAdapter mda = new SqlDataAdapter();
mda.SelectCommand = new SqlCommand(" select * from MyDatabase.atable;", myConnection);
SqlCommandBuilder cb = new SqlCommandBuilder(mda);
myConnection.Open();
DataSet ds = new DataSet();
MessageBox.Show("I am totally connected!");
myConnection.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
i go t that error The system detected an invalid pointer address in attempting to use a pointer argument in call
How about a WPF database connection example?
The first part does not make a lot of sense. When installing Visual Studio, it will install the SQL Server by default.
such a relief! Thanks bro 🙂
i've tried this and it seems work and shows "data saved" message box, but when i check on my sql the data wasn't saved. any help?
Watch it in Speed:1.5
an 18 minute video showing a single block of fucking code are you serious
why havent you answered jersons question?
slow. i cant take this mouse movements ;/
Why did you create data adapter and command builder?
Please,Sir.Can you tell me,the version name of MySql workbrench?
What if there's no MySql.Data in the add reference ?
is it okay to use VS 2015 in following this tutorial?
You can go through the easy way and connect your SQL Server database with C# application by means of new MySQL ODBC driver https://www.devart.com/odbc/mysql/download.html
ODBC driver connection guide https://www.devart.com/odbc/mysql/docs/driver_configuration_and_conne.htm
thanks brother
guys i'd like to replace localhost, port, username and password with textbox texts when pressing a button.
I tried MyConnection.Replace("localhost", textBox1.Text); but it does not seem to work. Suggestions?
nice
thanks for the link dumbass
i swear i hate thease indians
i follow this tutorial
now how can i create report
another program i use report viewer. but i have problem with connecting the report viewer with mysql database
any idea guy..
Why did you write the line about creating a MySqlCommandBuilder cb = new… as you are not using it anywhere in the code? I thought this would have to go in the myConn.Open(cb) and MyConn.Close(cb)?
Hi sir…!!! I have got a problem of signal encoding in c#. The user had to enter frequency and amplitude and accordingly we have to draw a sine wave of y=sin*2*pi*f*t , which should be displayed on a form. so please tell us how to draw the sine wave given frequency and amplitude?
dislike
i still cant find the MySQL.Data in the referencess
Thanks for video! How can i connect from the internet ? Not only from the local machine.
Hi! we're new on YouTube and make new tech videos, so make sure you subscribe and ask us questions and problems you've been facing for us to help!
So slow.
Have you ever used nobe.js
Thanks bro, this video opened my mind about Visual C#. I'm looking forward for the next episodes.
I am going to be taking a class soon and I was watching this video series before hand so it won't be such a shock to me when class starts. My question is, What is the difference between c# and c#.net? What should I be studying, and what are the advantages/disadvantages of learning this language compared to something like c++? I thank anyone who can help me understand this so I can be pointed in the right direction with my learning.
this is perfect thank you.
but i need to connect my c# app to a MySQL database in the server not in my localhost
anyone can help me please
Thank you
hi where can i contact u i want to ask many thing about c# can u teach me pls reply
i have an error with the data source