473,320 Members | 2,080 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,320 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 2174
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.