1. 绑定数据库的方法 SqlConnection con = new SqlConnection( " server=(local);database=department;uid=sa;pwd= " );con.Open();SqlCommand cm = new SqlCommand( " select empID,empName from emp " ,con);SqlDataReader dr = cm.ExecuteReader();