stored procedures - asp.net: which data collection should be used to return a table -
I am using a stored procedure to create a temporary table and return it to a data collection:
Public Static & gt; & Gt; Data collection & lt; & Lt; Report data (int intUserID) {SqlConnection con = Sql.getConnection (); Try {SqlCommand cmd = new SqlCommand (); CMD = New SQL Commands ("USP_Get_Ristals", Con?); Cmd.CommandType = CommandType.StoredProcedure; Cmd.Parameters.AddWithValue ("UserID", intUserID); Con.Open (); // put in data collection // return data collection} hold (exception pre) {// log error con.Close (); } Finally {con.Close (); }}
I do not know which data collection is best for returning. I might need to do some processing on this, although I'm not sure what would be best, performance is not a matter of major concern. I was thinking about a DataSet or DataReader, but I did not know whether anything Better suited or best practices
thanks
"Text">
is a general choice and works well for most things.
You can tie this man in one and get very much functionality from the phlegm.
- Custom style
- paging
Comments
Post a Comment