// Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["test"]); //test是web.config下设置的连接串
MyAdapter.SelectCommand = new SqlCommand("p_staff", myConnection);
// Mark the Command as a SPROC
MyAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;