Re: Creating a Project no form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



* tshad wrote, On 8-9-2009 23:08:
What if I created a Service App. Could I run that as either a Windows
Service or an executable run by the Scheduler.

It might be nice to build it that so that if later the customer wants to run
the executable the service would be already set up with a few changes.

If you put all the real functionality in a Class Library, you can reference this library from both a console app project and a windows service project. That gives you the flexibility of both types of applications and maximum reuse of your code.

While you're going to be loading a bunch of data into a Database (SQL Server?) you might also want to consider using Sql Server Integration Services combined with a Sql Agent Job. It's purposely built for DLT jobs like the one you're programming.

JEsse



Thanks,

Tom

"tshad"<toms@xxxxxxxx> wrote in message
news:%23B3qA5LMKHA.3588@xxxxxxxxxxxxxxxxxxxxxxx

"Peter Duniho"<no.peted.spam@xxxxxxxxxxxxxxxxxx> wrote in message
news:op.uzyb0qmsvmc1hu@xxxxxxxxxxxxxxxxxxxx
On Tue, 08 Sep 2009 11:27:39 -0700, tshad<toms@xxxxxxxx> wrote:

If I am using ASP.Net 2008, and I want to create an executable which
will
have no user interface and will only be run from the scheduler, what
type of
project do I create.

Can I create an ASP.Net a Windows Forms Application even if not using
the
form?

I don't understand the question. ASP.NET and Windows Forms are two
completely different kinds of projects, for completely different
purposes. And a program with no UI would not use either type of project,
because both ASP.NET and Windows Forms are defined (at least in part) by
how the UI is built.


You're right. What I should have said was .Net Windows Forms. I am also
going to have a web page but not for making changes to the tables, but
this app is only going to run once, read a bunch of csv files and update
tables based on what is in the files.

Depending on whether you want any output or not, you probably want to
build a console application, or a Windows Forms application in which
you've removed the default main form and associated calls in the
Program.Main() method (i.e. delete System.Windows.Forms from the project
references, and then delete any code that winds up with a compiler error
after you've removed that assembly reference).

So if I am going to use the Windows Forms Application, it starts like
this:
********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace TestApp
{
static class Program
{
///<summary>
/// The main entry point for the application.
///</summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
*********************************************************************

I then take out the:

System.Windows.Forms From the references

using System.Windows.Forms; From program.cs

forms.cs delete from the project.

I then get errors on "Application",

Error 1 The name 'Application' does not exist in the current context
C:\Documents and Settings\tscheiderich\My Documents\Visual Studio
2008\Projects\TestApp\TestApp\Program.cs 15 13 TestApp

So I take out the 3 lines that start out with Application and add a call
to my starting method

Is that right?

What would be the difference between this and a console app?

Thanks,

Tom
Pete






--
--
Jesse Houwing
jesse.houwing at sogeti.nl
.



Relevant Pages

  • Re: Slow booting xp home.
    ... Changing the boot order to boot first from your hard disk might save you a half second, but you won't be able to boot from a CD until you change it back - and the time spent to do that will erase any previous time saved. ... 2- Consider what software you really want to start with Windows and also how you've configured your applications at startup ... Installing and Registering Visual Studio Express Editions Smart Device ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Slow booting xp home.
    ... Thirty seconds to boot Windows? ... I read somewhere that Microsoft suggest 30s boot up on xp home, I have seen videos on youtube of 8s boot up on xp, I'd be delighted with 30s and happy just to get below a minute. ... Installing and Registering Visual Studio Express Editions Smart Device ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Remote connection failed
    ... If you are going over a remote connection or are not logging ... into the domain where SQL Server is then no, Windows ... authentication won't work. ...
    (microsoft.public.sqlserver.connect)
  • Re: Security Update for SQL Server 2005 Service Pack 2 (KB948109)
    ... If you're running Windows Live Mail, sign out then close the application. ... Understand that you can open a free support incident about your issues: ... When you call, clearly state that your problem is related to a Security Update and cite the update's KB number. ... SQL Server Database Services 2005 ENU SP2 ...
    (microsoft.public.windowsupdate)
  • Getting to the bottom of MSDE network connection problems ...
    ... but other than that it is MSDE 2000 with sp3a already applied. ... I've finally figured out the connection problems associated with this, ... and it seems the problems are due to Windows XP and not MSDE. ... the enterprise/standard versions of SQL server won't install ...
    (microsoft.public.sqlserver.msde)