As I continue to learn VS 2008 C# I would like to learn how to reverse the process of sending parameters down to SQL. The sample code shows sending down parameters now I want return values from SQL. From what I can gather, it is a good practice to have all your C# code calling sp's. So I want to create an sp that does the select as opposed to embedding it inside my code. Can anyone supply links to sample code that would illustrate how to return a set of values from a SQL sp back into the C# code?
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@COMPANYID", CompanyID));
cmd.Parameters.Add(new SqlParameter("@DCMTNMBR", VoucherNumber));
cmd.Parameters.Add(new SqlParameter("@MASTERTYPE", MasterType));
cmd.CommandText = "rbsUpdateJobLinkerDistSeq";
cmd.Connection = DataConnection;