C#으로 MySql 데이터베이스에 연결하려고합니다. 하지만이 오류가 발생합니다.My SQL 연결 오류 Microsoft] [ODBC Driver Manager] 데이터 원본 이름을 찾을 수없고 기본 드라이버가 지정되지 않았습니다.
Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
내 C# 코드
Connection con = new Connection();
Recordset rs = new Recordset();
string conStr = ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString();
con.Open(conStr); // Here its throwing the error
연결 문자열 :
<add name="DefaultConnection"
connectionString="DRIVER={MySQL ODBC 5.2w Driver};Server=localhost;Database=laundrydatabase;Uid=root;Pwd=123"
/>
내가
mysql-connector-net-6.6.5
MySQL ODBC 5.1 Driver}
사용하고 있습니다
당신은 ODBC 5.1을 사용하는 말을 드라이버를 연결 문자열에 당신은 5.2라고. 연결 문자열에 드라이버를 지정하지 않고 시도 할 수 있습니까? – DavidG
@Vivekh : ODBC 드라이버 대신 mysql .Net/C# 드라이버를 사용해 보시지 않겠습니까? – atur
그래, 내가 그들을 시도하고 지금 그들과 함께 일하고 있지만 그냥 ODBC를 통해 연결할 수없는 이유를 알고 싶어. – Vivekh