.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

what is the use of Command Line Arguments?

Posted By :Venkat     Posted Date :April 18, 2010    Points :10   Category :.NET Framework 
on start ->Run a run prompt appears and you type notepad.exe to runt he notepad application. Suppose you want to open particular file in notepad you can pass the command line argument like

Notepad.exe c:\MyLogFile.txt

The above statement will open the notepad application with the mentioned filed name.

Comming to programming life i would like to give few examples, which indicates the importance of command line arguments

1. Invoking a com component with different performance options
devEnv.exe /SafeMode
devenv.exe /reset
devenv.exe /nosplash
such command line arguments are used to start the application with different configuration settings

2. Start the executable with different language code passed during the execution
MyApplication.exe /en-US
MyApplication.exe /en-UK
MyApplication.exe /in-HN

It is upto the MyApplication.exe to handle how the command line arguments are used.


3. Suppose you have an application which should run differently depending on the client code or location code .You can pass thorugh command line.

static void Main(strng[] args) here args array recieves the command line arguments when invoking the program
args[0] 1st parameter
args[1] 2nd parameter and so on....

You can also find related Interview Question to what is the use of Command Line Arguments?  below: 

What happens when we issue Dataset.ReadXml command?

  
Reads XML schema and data into the DataSet. (More...)

what is used to execute a .net file from the command prompt ?

  
csc is C# compiler abbreviation is C Sharp Compiler (More...)

What command is used to create a table by copying the structure of another table?

  
CREATE TABLE .. AS SELECT command

Explanation :

To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement as in the following.
CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2;
If the WHERE condition is true, then all the rows or rows satisfying the condition will be copied to the new table. (More...)

Does VS.NET support line numbering in its text editor?

  
Yes, from the standard toolbar select Tools | Options.This will open the Options dialog; select the Text Editor folder, pick the language, and click on the check box for line numbering under the display section. (More...)

How To Update Description Value for a Column in Table using SQL Command?

  
We can Update Description to Column using sp_updateextendedproperty System Store Procedure.
Sample Command to Update Description for Column in a Table:

EXEC sys.sp_updateextendedproperty @name=N'MS_Description', @value=N'My Description for Column Here' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MyTableName', @level2type=N'COLUMN',@level2name=N'ColumnName' (More...)

How To Delete Description Value for a Column in Table using SQL Command?

  
We can Delete Description from Column using sp_dropextendedproperty System Store Procedure.
Sample Command to Delete Description from Column in a Table:

EXEC sys.sp_dropextendedproperty @name=N'MS_Description', @value=N'My Description for Column Here' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MyTableName', @level2type=N'COLUMN',@level2name=N'ColumnName' (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend