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
- Imports System.Data.SqlClient
- Public Class Form1
- Dim con As New SqlConnection
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Me.Hide()
- Try
- con.ConnectionString = ("Data Source=SHIVA\SQLEXPRESS2005;Initial Catalog=userdata;Persist Security Info=True;User ID=sa;password=pavanvsmginfo")
- con.Open()
- Using com As New SqlCommand("update users set no3=3", con)
- com.ExecuteNonQuery()
- com.Dispose()
- con.Close()
- End Using
- Catch ex As Exception
- MessageBox.Show("patch file is created ", "infomation", MessageBoxButtons.OK)
- End Try
- End Sub
- End Class