如何使用ODBC搭配dsn链接数据库
{ OdbcConnection cn; OdbcCommand cmd; string MyString; MyString="Select * from Customers"; cn= new OdbcConnection("dsn=myDSN;UID=myUid;PWD=myPwd;"); cmd=new OdbcCommand(MyString,cn); cn.Open(); MessageBox.Show("Connected"); cn.Close(); }