Monday, April 23, 2012

How to connect to MS- Access in VB.net


Dim conn As New OleDb.OleDbConnection
         conn.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Love.mdb"
        Try
             conn.Open()

        Catch ex As Exception
            MessageBox.Show(ex.Message, "connection to access failed")

        End Try
 Dim comm As New OleDb.OleDbCommand

  comm.CommandText = "delete from customer where ID = " & TextBox1.Text

         comm.Connection = conn

        If  comm.ExecuteNonQuery() = 1 Then
            MessageBox.Show("Successful")
        End If


         comm.CommandText = "select ID from customer where contact = '" & TextBox3.Text & "'"
         comm.Connection = conn

        Dim dr As OleDb.OleDbDataReader =  comm.ExecuteReader()

        If dr.HasRows Then
            Do While dr.Read()
                MessageBox.Show("The Customer id is " & dr("ID"))
            Loop

        End If


       conn.Close()


Monday, January 2, 2012

How to share internet connection over network


Go to My Computer > right-click and choose Manage
Double click "Services and Applications"
Double click "Services"
Scroll down to "Internet Connection Sharing" and double-click on it
On the "General" tab, set the Startup Type to "Automatic"
Click "Apply"
Click the "Recovery" tab
Click the "Subsequent Failures" button and select "Restart the Service"
Ensure that "Restart service after" is set to 0 minutes
OK out and close Computer Management
You should have the sharing tab now on the Properties of your network connection. In that tab go Just click the checkbox on share your internet connection over the network and you are done.