ion = new SqlConnection(connString); try { DataSet employeeDataset = new DataSet("EmployeesRoot"); //把需要执行的存储过程的名字和SqlConnection 对象作为参数传递进来 SqlDataAdapter adapter = new SqlDataAdapter(); SqlCommand command = new SqlCommand("Select * from Employees Where EmployeeID ="+ employeeID.ToString(),sqlConnection); //设置SqlCommand对象的属性 command.CommandType = CommandType.Text; adapter.SelectCommand = command; //使用存储过程返回的值填充数据集 adapter.Fill(employeeDataset,"Employees" ); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadX页码:[1] [2] [3] [4] [5] [6] 第5页、共6页 |