string str = "Data Source=.;Initial Catalog=SCR_2p0_Staging;Integrated Security=True";
SqlConnection conn = new SqlConnection(str);
conn.Open();
string text = "dt_AdminTool_ServiceObjectChildList";
SqlCommand command = new SqlCommand(text, conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("parentid", SqlDbType.Int).Value = id;//parentid 输入的参数
SqlDataReader reader = command.ExecuteReader();
reader["child_id"].tostring();
reader["child_name"].tostring();//child_id和child_name都是数据库里的字段名
转载于:https://www.cnblogs.com/shilei/archive/2008/01/06/1027953.html