用sa登录数据库,假设数据库为MyDB
string strcon="Data Source=(local);Initial Catalog=MyDB;Persist Security Info=True;User ID=sa;Password=123";SqlConnection conn = new SqlConnection(strcon);conn.Open();