1. mysql.com/downloads/mysql
다운로드 후 설치
2.
create database cmdb;
use cmdb;
create table member(
no int ,
name varchar(20),
tel varchar(20),
detailadd varchar(20),
post_no char(7)
);
create table post(
no char(7),
address varchar(20)
);
VS용 컨넥터 다운 받기
http://www.myasql.com/downloads/connector/net/
설치후 VS 에서 Reference 를 참조
mysql.data
mysql.data.entity
runtime 을 보면 V4.0.30319.Net 버전 4
static void Main(string[] args)
{
string connectionString = "Data Source=localhost;port=3333;Initial catalog=cmdb;User id=root;Password=1234;";
try
{
MySqlConnection 연결 = new MySqlConnection(connectionString);
연결.Open();
Console.WriteLine(연결);
string sql = "insert into post values('111-111','seoul seocho')";
MySqlCommand 명령 = new MySqlCommand();
명령.CommandText = sql;
명령.Connection = 연결;
명령.ExecuteNonQuery();
연결.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
연결 완료 실행완료 ㅋ
현제까지 작업한 소스 파일들.~ ( 별 필욘없지만.;;)
'IT 전용글 > C#' 카테고리의 다른 글
다시 (0) | 2012.07.29 |
---|---|
마지막. (0) | 2012.07.29 |
2012 07 22 상속 및 mysql 연결 테스트 관련 소스 (0) | 2012.07.22 |
20120708 C# 수업. (0) | 2012.07.08 |
Microsoft C# 2010 Express 다운로드 및 설치 방법. (0) | 2012.07.08 |