Click here to Skip to main content
12,501,683 members (45,355 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
Dear Friends,

I have created a window based application to get dates(From Date and To Date) which compares the Booking Date from the database and result will be displayed on Crystal report Viewer.

I created an exe file of it and tried to execute on Command Prompt. But i am not getting how to get those parameter in Form_Load event(crystalReportViewer1_Load).

Can anyone please help to solve this....

My command-line will be

c:> testRptExe '18/12/2012' '26/12/2012'
Posted 18-Dec-12 17:27pm
Updated 18-Dec-12 17:38pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

This makes no sense at all. If it's windows based, there is no code behind and it's not ASP.NET. If it's a windows app, the parameters are passed in to the entry point as an array. And, your question therefore is nonsensical
  Permalink  
Comments
Member 9501115 18-Dec-12 23:37pm
   
I am Sorry... I don't have much idea abt Window based app's. I thought the Form_Load() method will be the code-behind . So i used that word.. But i need solution for question!!!
Christian Graus 18-Dec-12 23:41pm
   
Despite your question being a nonsense, I answered it. The entry point for your app is passed a collection of strings, that is the command line parameters. I don't have a windows based app open, but I think it's Program.cs that it lives in. Look for a Main method.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

you can use this to read command line arguments from non-main method
foreach (string arg in Environment.GetCommandLineArgs())
{
    Console.WriteLine(arg);
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100