Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to change to .exe file?

Posted on 2004-04-11
11
Medium Priority
?
389 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
LVL 1

Accepted Solution

by:
dapcom earned 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Six Sigma Control Plans

705 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