Source Code



Database Connection

  • Fandi Susanto
  • 14 November 2013 at 17:05
  • C Sharp
  • 409
  • 51
  • United States
 


Author: Fandi Susanto Language: United States
License: Freeware
Size: 0 KB
Downloads: 23 times

 

To use database in C#, we must first connect to the database. To do that, we use a Connection object. In this case, we use MySqlConnection class. Basically, the code to connect to a database are:

var conn =
new MySqlConnection();
conn.ConnectionString = Server=localhost; Uid=root; Pwd=123; Port=3306;;
conn.Open();
//Do something to the database
conn.Close();
comments powered by Disqus

Related Code

Reading From Database

Rich-Text Editors for Web

Alpha Control

Restful Webservice Call And Get And Parse JSON Data

Camera Video Capture And Save On SDCard

Simple Code Javascript

Boolean

Try Command

Rapid CSS Editor 2007

HTML5 Video Player - jQuery Plugin, Ajax XML



Category

Tag Linked