473,795 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2203
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******@hotma il.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******@hotma il.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******@hotma il.com> wrote in news:010f01c38f 4b$73d676e0
$a*******@phx.g bl:
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******@hotma il.com> wrote in news:010f01c38f 4b$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******@hotma il.com> wrote in news:130f01c393 64$b710f3a0
$a*******@phx.g bl:
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.Ole Db

Module Module1

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

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

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

cn.Open()

cmd.ExecuteNonQ uery()

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
2672
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 running at background and using system account, so the applcation it lunchs is also running at the background. is there a way to lunch the windows application as current logged in user? Thanks
9
2825
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 facing. Please please help me to solve this as soon as possible. So here we go ... I am not able to take the screen shot of the windows form based "Smart
9
7273
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 stopping. Please advise how to stop the service. Thanks, SP
4
2426
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). The problem is that the user who "owns" the service is always the ASPNET account. That's not good since you don't see the actual application (because it's owned by ASPNET). I've tried changed the processmodel section in the machine.config file to...
4
4185
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 check to see if the status is in stopped or running mode. But that doesn't tell me if it is actually running. I need to know this so that if it happens I can programmatically start the same service on another machine.
15
7089
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 every second. I remote desktop to the computer hosting this application and run the application. It starts up and displays the counter incrementing every second. If I disconnect the network cable between the two computers for 10 seconds and...
2
4503
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 seperate process. If my windows application starts running,only if it completes fully, then my windows services should continue its execution. My main process is Windows service.
1
4854
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 seperate process. If my windows application starts running,only if it completes fully, then my windows services should continue its execution. My main process is Windows service.
0
30248
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 a comprehensive list of all autostart locations for Windows OSes: NOTE : These are some abbreviations used in this list. Please note them carefully: HKCU = HKEY_CURRENT_USER HKLM = HKEY_LOCAL_MACHINE
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10216
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.