473,386 Members | 1,803 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,386 software developers and data experts.

how to run a program without loading a form but it would show a msgbox

shivananda
Hi one & all , Hope every one doing well
I am new to vb.net .
Here i am trying to create a patch file after executing a program no3 fieldof a table is updated in sqlserver database ,its updating field successfully,
here is one problem ,form is not hiding don't want to show the form and want to show only msgbox with a message "patch is created "
But in my code that is not happening
here is my code

thanks in advance. :)

Expand|Select|Wrap|Line Numbers
  1. Imports System.Data.SqlClient
  2. Public Class Form1
  3.     Dim con As New SqlConnection
  4.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  5.         Me.Hide()
  6.         Try
  7.             con.ConnectionString = ("Data Source=SHIVA\SQLEXPRESS2005;Initial Catalog=userdata;Persist Security Info=True;User ID=sa;password=pavanvsmginfo")
  8.  
  9.             con.Open()
  10.             Using com As New SqlCommand("update  users set no3=3", con)
  11.                 com.ExecuteNonQuery()
  12.                 com.Dispose()
  13.                 con.Close()
  14.             End Using
  15.         Catch ex As Exception
  16.             MessageBox.Show("patch file is created ", "infomation", MessageBoxButtons.OK)
  17.  
  18.         End Try
  19.  
  20.  
  21.     End Sub
  22. End Class
May 28 '13 #1
6 1329
IronRazer
83 64KB
You can try setting the forms Opacity property to (0.0). Also putting the messagebox inside the Catch is only going to show it if there is an error. I am not sure if that is what you intended or not.
Expand|Select|Wrap|Line Numbers
  1.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         Me.Opacity = 0.0
  3.         Me.ShowInTaskbar = False 'Set this if you don`t want it to show in the taskbar
  4.  
  5.         'Do whatever you want here
  6.  
  7.         MessageBox.Show("patch file is created ", "infomation", MessageBoxButtons.OK)
  8.     End Sub
  9.  
May 28 '13 #2
vijay6
158 100+
Here i am trying to create a patch file after executing a program no3 fieldof a table is updated in sqlserver database
Hey shivananda, if this is your requirement means then why not you go for console application instead of windows application?
May 28 '13 #3
thanks Viji,
Sorry to ask this , what is this console application and how to use this can explain please.............
thank you
May 29 '13 #4
thanks IronRazer ,
good job , its working
thanks a lot, thank you :)
May 29 '13 #5
Oralloy
988 Expert 512MB
shivananda,

Please mark IronRazer's answer as correct - this is so that other folks, trying to do the same thing, do not have to dig through all the posts to find the solution.

--Oralloy
May 29 '13 #6
vijay6
158 100+
Hey shivananda, see this link...

Console Application
May 29 '13 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Alan | last post by:
While not rs.eof <td><%=rs("InvoiceNo")%></td> <td><%=rs("Name")%></td> <td><a href="InvoicePrint.asp?WInv=<%=rs("InvoiceNo")%>"></a></td> <td>Print this invoice</td> rs.MoveNext Wend Now...
11
by: Neo | last post by:
Does anyone know how to get a list of the types in an Assembly without actually loading the Assembly into your app domain?
6
by: Paul BJ | last post by:
I have developed a mini-app that does some routine maintenance tasks on my Outlook 2003 files. For the dev process, I ran a form with just a GO button on it but now that the app is ready for...
5
by: AlexGray | last post by:
Hi, I created a blank Form with one Label, and the Label's text says "Loading... Please wait.". I display this form in Main() with Show() while i do some lengthy initialization stuff (ie...
1
by: Gidi | last post by:
Hi, I'm writing a windows application and i need to check if a certain file exsits before i'm loading my MainForm. Incase the file doesn't exsit, i want to load a different form (without...
3
by: yzi | last post by:
I have a list form and a detail form . Before, I open the List form, use form.showDialog(),then I click List Item and open the Detail Form by form.show(). now , user need when the list form...
3
by: steve | last post by:
Hi All I need help on how to load a form in the background so the load event runs (only once) then I can pass data and call showdialog I have code in the forms load event which populates...
2
by: dmitrey | last post by:
Hi all, here is a question already mentioned below, and I'm also interested in that one very much. unfortunatly, I can't write anything to matplotlib mailing lists because I constantly get server...
1
by: Franck | last post by:
I have a form with a loading bar as marquee so i don't need to play with the progress thing. It's just a form to show activity in other way. So what i need to do is start it at the beginning of...
9
by: gnawz | last post by:
Dear experts, I need some one to tell me how to design a website in php or other scripting technology such that when a user clicks on links or an image in the site, information is displayed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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:
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...
0
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,...
0
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...

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.