Solved

How to change to .exe file?

Posted on 2004-04-11
11
381 Views
Last Modified: 2010-04-17
Hi expert,

Currently I'm using Microsoft Visual Studio.Net to program an application.
Now I need to run the application in scheduler task.
May I know to change the program so that it can run as .exe file?
Thanx.

Regards,
Joanne84
0
Comment
Question by:joanne84
11 Comments
 
LVL 12

Expert Comment

by:guidway
ID: 10803296
when you compile your project it should create the executable automatically. You may need to search for the name of it on the computer. If you have errors during the compile it will not create the executable until they are all fixed.
0
 

Author Comment

by:joanne84
ID: 10803969
Hi,

The compilation is error free.
But how can I find the .exe file?

Is it namely filename.exe?

Please advise.
Thanx.

Regards,
joanne84
0
 
LVL 8

Expert Comment

by:harris_c
ID: 10804258
Hi Joanne84,

The name is usually the project name.  It is in *bold* letters in the solution explorer window.

You can find the executable in the "bin" directory in your project folder.



hec",)
0
 
LVL 22

Expert Comment

by:cookre
ID: 10805603
<ProjectDirectory> \ bin \ 'debug' or 'release'
0
 

Author Comment

by:joanne84
ID: 10809766
Hi,

The schedule task still show me the status: Could Not Start...

For ur information, the scheduler that I want to run is scheduler.aspx, which is inside a project namely, Seminar. I can only found Seminar.pdb and Seminar.dll in the bin folder.

I tried to run both file, also cannot. Do I need to create a new project name Scheduler instead?
Otherwise, please advise.

Thanx.

Regards,
joanne84
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Accepted Solution

by:
dapcom earned 50 total points
ID: 10814537
It seems your project is a Web Application, so there's no exe file created.

It might have been a better idea to create a Windows application?

What do you expect from the scheduled application? Is it supposed to open in a browser? Is the aspx supposed to run on your PC or on a server?

If a Web application is really what you need (or can't change it). You need to use the URL of the aspx in the web server.
If on your own PC, it must be something like : http://localhost/Seminar/scheduler.aspx, unless you configured your web server otherwise.
If on another web server, it depends where it was installed.

Did I add some light?

Dan


0
 

Author Comment

by:joanne84
ID: 10819538
I get what you mean.
So, now I've created a window application.
And I copied the coding in .aspx to the window application.

Where  should I put the db connection as in web application, we put it in web.config?

It shows a break point at       
dr = myCommand.ExecuteReader();

An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll
Additional information: The ConnectionString property has not been initialized.

I still fresh to .net, so sorry for my poor understanding...

Regards,
joanne84

0
 
LVL 1

Expert Comment

by:dapcom
ID: 10832286
To start, just put it in your code:
    Dim myConnectionString as String = "Your connection string"
    Dim myConnection As New SqlConnection(myConnectionString)
    Dim myCommand As New SqlCommand(mySelectQuery, myConnection)
    dr = myCommand.ExecuteReader();

when it works, create an application.config file in the same folder as the exe, same name, but extension .config:
<configuration>
   <appSettings>
      <add key="ConnectionString" value="type your connection string here" />
   </appSettings>
</configuration>

Then use the ConfigurationSettings class to replace the hardcoded connection string.

myConnectionString=ConfigurationSettings.AppSettings("ConnectionString")

(you can have a look at : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriintroductiontoapplicationsettingstorage.asp)

Dan
0
 

Author Comment

by:joanne84
ID: 10839553
Hi Dan,

For your info, I'm using C#...
I've created a Form1.config to put the database configuration, but the previous error still occur...

To have clear idea of my project, below are some of the code:

[STAThread]
static void Main()
{      Application.Run(new Form1());           }

private void button1_Click(object sender, System.EventArgs e)
{      this.Close ();      }
public Form1()
{      InitializeComponent();
      Run();
}

In the Run(), I retrieve information from a userclass, which return datareader, dr.

It shows a break point at      
dr = myCommand.ExecuteReader();   //Occur in the user class file

Do you have any solution?
Thanx in advance.

joanne84
0
 
LVL 1

Expert Comment

by:dapcom
ID: 10840936
Hi joanne84,

Thanks for the points :)

Your file should have the name of the application, not the form. In your case I think it is Seminar.config and must be in the same directory as your exe (in bin).

Did you translate the code i gave you in C# or do you need help for that?
Do you have the same error message?
It seems the connection string is not set. You must retrieve it with the

ConfigurationSettings.AppSettings("ConnectionString")

The easiest would be if you send the code of the Run() procedure (or the relevent part of it, around the error), so I can have a look at it.



Dan

0
 

Author Comment

by:joanne84
ID: 10847127
Hi Dan,

Thanx for your help.
I already solved the problem.

Actually, I just need to create a console application, then use a web client to call the URL of the file that I want it to run, for this case is Scheduler.aspx.

Then in the scheduler task, I call the console application's application file, then can already.

Thanx:-)

Regards,
joanne84

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 105
wordappend challenge 8 85
What is Python programming? 3 68
Basic Java Case or If-Else statement... 3 5
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 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

14 Experts available now in Live!

Get 1:1 Help Now