Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
hi all,

i am using sharp develop with mysql database , i want to start off with simple applications(not too simple)..i want some examples to help me out..can anyone please help me out..


thanks in advance,
Posted

This [^] could help you get started.
 
Share this answer
 
Comments
girish sp 26-Apr-11 4:24am    
my 5..thanks:)
Abhinav S 26-Apr-11 6:13am    
Welcome.
Sergey Alexandrovich Kryukov 26-Apr-11 15:26pm    
There is a ready-to-use ADO.NET binding assembly as well. Kim and Wayne provided a reference.
--SA
Start by using MySQL Connector/Net[^].

Add a ref to MySQL dll.

Then you can start doing SQL calls.
System.Data.Common.DbConnection sqlConnection = new MySql.Data.MySqlClient.MySqlConnection("server=localhost;user id=sqlaccess;password=sqlpass;database=testdb;");
try
{
  string sql = string.Format("UPDATE tb1 SET type='12' WHERE id=2");
  sqlConnection.Open();
  System.Data.Common.DbCommand sqlCommand = sqlConnection.CreateCommand();
  sqlCommand.CommandText = sql;
  sqlCommand.ExecuteNonQuery();
  sqlConnection.Close();
}
catch (Exception ex)
{
  MessageBox.Show("Ups, exception: " + ex.Message);
}
finally
{
  sqlConnection.Close();
}


Have fun :-)
 
Share this answer
 
v2
Comments
girish sp 26-Apr-11 4:23am    
my 5..thanks:)
Kim Togo 26-Apr-11 5:40am    
You are welcome :-)
Sergey Alexandrovich Kryukov 26-Apr-11 15:27pm    
Sure, a 5.
--SA
Kim Togo 27-Apr-11 2:40am    
Thanks SA.
I prefer to use MySQL Connector/Net which can be downloaded Here[^]. There are also good tutorials on the MySQL site Here[^]

Hope this helps
 
Share this answer
 
Comments
Kim Togo 26-Apr-11 4:08am    
My 5. Good link to MySQL site.
Wayne Gaylard 26-Apr-11 4:18am    
Thanks
girish sp 26-Apr-11 4:23am    
my 5..thanks:)
Sergey Alexandrovich Kryukov 26-Apr-11 15:28pm    
Sure, my 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900