473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Windows Application

Hi,
I would like to run a windows application without the user
interface. Console application is not a choice because it
does not allow to use ADO controls. When I start the
Windows Application I do not want to see the Form and
click some buttons to start a program. The program should
start executing the main program immediately.

Thank you very much for help.
Jul 21 '05 #1
5 2177
If you're referring to a .net windows application, you can use ADONet
controls in console apps - just add a reference to the system.data
namespace.

You could also just start your code in the New() or form load event, rather
than putting it into a button click event handler.

If the app needs to run in the background, another option would be to take a
look at windows services.

--

Regards

Tim Stephenson MCSD.NET
Charted MCAD & MCSD.NET Early Achiever
"joseph" <cm******@hotmail.com> wrote in message
news:27*****************************@phx.gbl...
Hi,
I would like to run a windows application without the user
interface. Console application is not a choice because it
does not allow to use ADO controls. When I start the
Windows Application I do not want to see the Form and
click some buttons to start a program. The program should
start executing the main program immediately.

Thank you very much for help.

Jul 21 '05 #2
Hi,

Thank you very much for the quick response.

The application is .Net Windows Application. This program
reads a log file and search for previous days information.
Right now I have to start the application and input the
date value and click the process button. I want to run
this program in a batch file and pass the date value as a
parameter.
I searched for New() event in the .Net help file and no
reference can be found. Is this event a Form Event? I do
not see this event listed in the form property.

Also Microsoft do not recomment long processing program in
Form load event. Form load event is usually used to set up
the environment.

The question is can I modify the Windows Application main
program and run a procedure instead of Form.

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

-----Original Message-----
If you're referring to a .net windows application, you can use ADONetcontrols in console apps - just add a reference to the system.datanamespace.

You could also just start your code in the New() or form load event, ratherthan putting it into a button click event handler.

If the app needs to run in the background, another option would be to take alook at windows services.

--

Regards

Tim Stephenson MCSD.NET
Charted MCAD & MCSD.NET Early Achiever
"joseph" <cm******@hotmail.com> wrote in message
news:27*****************************@phx.gbl...
Hi,
I would like to run a windows application without the user interface. Console application is not a choice because it does not allow to use ADO controls. When I start the
Windows Application I do not want to see the Form and
click some buttons to start a program. The program should start executing the main program immediately.

Thank you very much for help.

.

Jul 21 '05 #3
"Joseph" <cm******@hotmail.com> wrote in news:010f01c38f4b$73d676e0
$a*******@phx.gbl:
I searched for New() event in the .Net help file and no


New is the form's constructor. It's not an event.

As the other poster said, you should be able to use a console application.
You can use ADO.Net with it just fine. What's stopping you?

Chris
Jul 21 '05 #4
The problem in using ADO.Net in console application is
that the Data omponent like OleDataAdapter and
OleDbConnection are not available to connect to an Access
2000 database. I got some sample ADO.Net program to
connect to Access 2000 database, but it does not work. If
you have some working ADO.Net program to connect to Access
2000 database and add,edit and delete records please post
it.
Thanks.
-----Original Message-----
"Joseph" <cm******@hotmail.com> wrote in news:010f01c38f4b$73d676e0$a*******@phx.gbl:
I searched for New() event in the .Net help file and no
New is the form's constructor. It's not an event.

As the other poster said, you should be able to use a

console application.You can use ADO.Net with it just fine. What's stopping you?
Chris
.

Jul 21 '05 #5
"Joseph" <cm******@hotmail.com> wrote in news:130f01c39364$b710f3a0
$a*******@phx.gbl:
If you have some working ADO.Net program to connect to Access
2000 database and add,edit and delete records please post
it.


Here is a *very* small console app that inserts a record into an Access
table. The access database has one table with three fields named
"NumberField","TextField", and "MoneyField".

The app takes each value from the command line and updates the table.
This app doesn't do much but it can connect to an Access database.

(Watch for line wrapping)
'\\\\\\\\\\\\\\\\\
Imports System.Data.OleDb

Module Module1

Private ConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" User
ID=Admin;Data Source=C:\test\db1.mdb;Mode=Share Deny None"

Sub Main(ByVal CmdArgs() As String)
Dim cn As New OleDbConnection(ConnStr)
Dim cmd As New OleDbCommand

With cmd
.CommandType = CommandType.Text
.CommandText = "Insert into Table1 (NumberField, TextField,
MoneyField) " & _
"VALUES (" & CmdArgs(0) & ",'" & CmdArgs(1) &
"'," & CmdArgs(2) & ")"
.Connection = cn
End With

cn.Open()

cmd.ExecuteNonQuery()

cn.Close()
cmd.Dispose()
cn.Dispose()
End Sub

End Module
..///////////////////

Hope this helps,

Chris
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael | last post by:
Hi, I have a windows service developed using c# and it needs to lunch another windows application. I have been trying to use Process class to do it but the problem is becase windows service...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
9
by: SP | last post by:
Hi All, I wrote a windows service which is supposed to stop after specified amount of time. I am calling OnStop() after specified time. OnStop() methods executed but I dont see the service...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
15
by: =?Utf-8?B?TVNU?= | last post by:
To demonstrate my problem, I have a very simple VB Windows application. It has a text box that is used to display a counter, a button to reset the counter, and a timer that increments the counter...
2
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as...
1
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.