使用sqlconnection对象连接到数据库吧stringstr="datasource=database=..uid=..pwd=.."

sqlconnectionconn=newsqlconnection(str)