Solved

command line argument

Posted on 2011-02-18
3
276 Views
Last Modified: 2012-06-21
Hi, Have a look at this Main function in my .Net windows application:

static void Main(string[] args)
        {
            try
            {
                if (args.Length == 2)
                {
                    DDIManager dDIManager;

                    DDIManager.DatabaseServer = args[0].Trim();
                    DDIManager.DatabaseName = args[1].Trim();

                    Logger.Information("Working with database '" +
                        DDIManager.DatabaseServer + "\\" +
                        DDIManager.DatabaseName + "'");

                    dDIManager = new DDIManager();
                    //dDIManager.ProcessReturnedAUDDACInstructions();
                    //dDIManager.ProcessReturnedARUDDInstructions();
                    //dDIManager.ProcessReturnedAUDDISInstructions();
                    dDIManager.ProcessNewDDIs();
                    dDIManager.ProcessAmendedDDIs();
                }
                else
                {
                    Help("Invalid parameters");
                    LogHelp("Invalid parameters");
                }
            }
            catch (Exception exp)
            {
                Logger.Error(exp);
            }
        }
I have been looking into whole solution to find the connection string for this project but found nothing. But by the looks of it this must be paased as a command line argument and, if that is the case where do I find what has been passed?

Is that the location where this executable is running from.
0
Comment
Question by:ube100
3 Comments
 
LVL 10

Accepted Solution

by:
himanshut earned 125 total points
ID: 34924845
just put a breakpoint in front of
Logger.Information("Working with database '" +
                        DDIManager.DatabaseServer + "\\" +
                        DDIManager.DatabaseName + "'");
and when the execution comes at this line, just hover the mouse pointer over these values to get the names
OR right click on

                    DDIManager.DatabaseServer = args[0].Trim();
                    DDIManager.DatabaseName = args[1].Trim();
Args, and add quick watch to get the values.

They are coming from DDIManager dDIManager;
0
 
LVL 3

Assisted Solution

by:imaki06
imaki06 earned 125 total points
ID: 34924847
You are right, this program gets database server and database name values from command line arguments.

You could try to check the shortcut which is used to start this program, and see if there is comman line arguments. Or if it is a batch (.bat) file, that file can be opened with notepad to see the arguments.
0
 

Author Closing Comment

by:ube100
ID: 34991590
Helps me in some way.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now