Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:11:48+00:00 2026-05-22T18:11:48+00:00

So I have a database (sql) management program I have been working on, dealing

  • 0

So I have a database (sql) management program I have been working on, dealing with items my company sells. For the main part of the program the item information is updated as the user goes through using some custom controls. That all works fine. But now I am on to the higher level section of the program that is adding/deleting/copying items. This cannot be “update on the fly”, like editing item information, as it would be too easy to screw things up very badly. So I basically want to set up a file-> save type of deal for them here. How I see this working is creating all of the sql commands in a list and then running them all when saving.

The functions available here would be adding a new item, deleting an item, copying from another item, and renaming.

So it would be a list like:

insert...
update...
update...
delete...
update...
etc.

It would run through and execute all of the commands. The problem I am having is I already have a class that has methods to handle all of these functions. I can’t think of a way to call all of those methods in a queue, and rewriting all the sql statements in another class seems stupid to me. Is there a way that I can remember a list of something like:

item.Rename()
item.ChangeSize()
item.Delete()

I feel like I’m overthinking this… or maybe underthinking… I don’t know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:11:49+00:00Added an answer on May 22, 2026 at 6:11 pm

    What you are looking for is a Command Pattern.

    The basic idea is that you have an ICommand Interface which has a method Execute().
    Then you implement multiple ConcreteCommand, e.g. a RenameCommand with a parameterized constructor or a property NewName.

    Dont’t forget to handle exceptions accordingly and maybe implement an Undo-Method as well, if these could occur. I don’t know enough about your application to make assumptions here.

    public interface ICommand
    {
        void Execute();
    }
    
    public class RenameCommand : ICommand
    {
        private string newName;
    
        public RenameCommand(string newName)
        {
            this.newName = newName;
        }
    
        void ICommand.Execute()
        {
            item.rename(newName);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a database running in SQL Server Management Studio. The server information
We have a job management application running (Access) with the database in SQL Server
I have an SQL database with multiple tables, and I am working on creating
Currently, changes to the database are made through the SQL Server Management program. IF
I have been investigating some performance issues with my database (SQL Server 2008). SQL
I have a database that I am viewing with SQL Server Management Studio 2008
Using SQL Server Management Studio, I have backed up a database from one server
I don't have SQL Server Management Studio on my machine. I have a database
I have a database (using Microsoft SQL Server Management Studio Express) that is currently
We have a database (SQL Server 2005) which we would like to get under

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.