B
Brian Simmons
Hi All,
Many moons ago, I remember the ASP.NET Pro magazine publishing an article
about a Winform utility that generated stored procedure .net calling code.
i.e. if you have stored proc had 5 params it would generate some text you
could copy & paste into your code, like this (just a sample, may be typos):
SqlCommand myComm = new SqlCommand("sp_test", myConn);
myComm.CommandType = CommandType.StoredProcedure;
SqlParameter emailParam = new SqlParameter("@Email",
SqlDbType.VarChar, 255);
SqlParameter passwordParam = new SqlParameter("@Password",
SqlDbType.VarChar, 255);
SqlParameter userIDParam = new SqlParameter("@UserID",
SqlDbType.Int);
userIDParam.Direction = ParameterDirection.Output;
SqlParameter isAdminParam = new SqlParameter("@IsAdmin",
SqlDbType.Bit);
isAdminParam.Direction = ParameterDirection.Output;
SqlParameter returnValue = new SqlParameter("@RETURN_VALUE",
SqlDbType.Int);
returnValue.Direction = ParameterDirection.ReturnValue;
myComm.Parameters.Add(emailParam);
myComm.Parameters.Add(passwordParam);
myComm.Parameters.Add(userIDParam);
myComm.Parameters.Add(isAdminParam);
myComm.Parameters.Add(returnValue);
Basically, it generated a pretty good skeleton of code that you could add
upon. You just picked the stored proc from a list of available ones, and it
clicked generate.
Anybody know of such a beast?
Thanks,
Brian
Many moons ago, I remember the ASP.NET Pro magazine publishing an article
about a Winform utility that generated stored procedure .net calling code.
i.e. if you have stored proc had 5 params it would generate some text you
could copy & paste into your code, like this (just a sample, may be typos):
SqlCommand myComm = new SqlCommand("sp_test", myConn);
myComm.CommandType = CommandType.StoredProcedure;
SqlParameter emailParam = new SqlParameter("@Email",
SqlDbType.VarChar, 255);
SqlParameter passwordParam = new SqlParameter("@Password",
SqlDbType.VarChar, 255);
SqlParameter userIDParam = new SqlParameter("@UserID",
SqlDbType.Int);
userIDParam.Direction = ParameterDirection.Output;
SqlParameter isAdminParam = new SqlParameter("@IsAdmin",
SqlDbType.Bit);
isAdminParam.Direction = ParameterDirection.Output;
SqlParameter returnValue = new SqlParameter("@RETURN_VALUE",
SqlDbType.Int);
returnValue.Direction = ParameterDirection.ReturnValue;
myComm.Parameters.Add(emailParam);
myComm.Parameters.Add(passwordParam);
myComm.Parameters.Add(userIDParam);
myComm.Parameters.Add(isAdminParam);
myComm.Parameters.Add(returnValue);
Basically, it generated a pretty good skeleton of code that you could add
upon. You just picked the stored proc from a list of available ones, and it
clicked generate.
Anybody know of such a beast?
Thanks,
Brian