Ejemplo n.º 1
0
        public dsUser UserByID(int id)
        {
            dsUser        tempDS     = new dsUser();
            SqlConnection connection = new SqlConnection(
                Configuration.GetValue("DSN"));

            connection.Open();

            SqlCommand command = new SqlCommand();

            command.CommandText = "FindUserByID";
            command.CommandType = CommandType.StoredProcedure;
            command.Connection  = connection;
            SqlParameterCollection parameters = command.Parameters;

            DbUtility.AddParameter(parameters,
                                   SqlDbType.Int, 50, "@id", id);

            SqlDataAdapter da = new SqlDataAdapter(command);

            da.Fill(tempDS);

            connection.Close();

            return(tempDS);
        }
Ejemplo n.º 2
0
 public void Save(dsUser p_ds)
 {
     //this is executed from authorize.aspx
     DbUtility.ExecStoredProcForSave(
         p_ds.Tables[0],
         User_Insert(),
         User_Update(),
         User_Delete());
 }
Ejemplo n.º 3
0
        public dsUser GetAllUsers()
        {
            dsUser        tempDS     = new dsUser();
            SqlConnection connection = new SqlConnection(
                Configuration.GetValue("DSN"));

            connection.Open();

            SqlCommand command = new SqlCommand();

            command.CommandText = "Users_GetAll";
            command.CommandType = CommandType.StoredProcedure;
            SqlParameterCollection parameters = command.Parameters;

            command.Connection = connection;

            SqlDataAdapter da = new SqlDataAdapter(command);

            da.Fill(tempDS);

            connection.Close();

            return(tempDS);
        }