DbConnection CreateCommand Stored Procedure window form
Hello,
I have a function that works but I need to change it in Stored Procedure called "viewAllUsers". Could you tell me what I need to change to make it works?
private List<User> GetUsersFromDB(DbConnection cnx)
{
List<User> users = new List<User>();
using (DbCommand cmd = cnx.CreateCommand())
{
cmd.CommandType = System.Data.CommandType.Text;
cmd.CommandText = "SELECT * FROM UserTable";
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx
the concept is same just use DbConnection incase of SqlConnection ( same for command and reader)