I want to get a list of result sets and columns that i can expect from a SP. I have been able to get at the parameters, script... but i don't know where to get at the result sets and column names.
using Microsoft.SqlServer.Management.Smo;
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["mydbconn"].ConnectionString))
{
conn.Open();
Server sv = new Server(new Microsoft.SqlServer.Management.Common.ServerConnection(conn));
Database db = sv.Databases["mydb"];
foreach (StoredProcedure sp in db.StoredProcedures)
{
string[] columns = sp.??????
}
}
Is there a way to get at the columns? I'm ultimately trying to write a code generator to automate my writing data access objects. Thanks SO!
EDIT: "Another solution is if you can get at the value of ScalarResult, you may be able to convert it into something useful that you can derive the columns from." : Any ideas how to get at that?