Mike,
Is it possible to return a dataset from a stored procedure, or would you
need to write the SQL in your .cs file to return the dataset?
It's actually the same thing! Supposing you have a stored proc like:
CREATE PROC uspTestProc
AS
SELECT * FROM tblTest
GO
In your C# code, you might have a string variable called strSQL, so the
following two statements are functionally identical:
string strSQL = "EXEC uspTestProc";
string strSQL = "SELECT * from tblTest";
Of course, there are many good reasons for using stored procedures instead
of in-line SQL. Notably, stored procedures are pre-compiled by the server
engine so almost always execute more quickly, and they also go a long way to
help preventing SQL injection attacks.
Mark