Results 1 to 4 of 4

Thread: [2005] simple employee database program

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Location
    india
    Posts
    88

    Wink [2005] simple employee database program

    I am making a simple program to keep database of employee at office but its been long since I used vb.net I used to connect through sql server
    but now I am trying to use, ms access as database here is my problem.

    I cannot insert data into database entered from textboxes can someone help me with this code.

    Then I want to populate this on a grid and provide a search option some examples of this program if you can suggest me please let me know

    thanks need this badly my job is at stake :P
    I am designer by the way



    this is what i have created so far

    PHP Code:
     Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
            
    Try
                If 
    cn.State ConnectionState.Open Then cn.Close()
                
    cn.Open()
                
    cmd = New OleDb.OleDbCommand("insert into main values('" TextBox1.Text "','" TextBox2.Text "')"cn)
                
    cmd.ExecuteNonQuery()
                
    MessageBox.Show("record added""success")
                
    cn.Close()

            Catch 
    ex As Exception
                MessageBox
    .Show("error occured")
            
    End Try
        
    End Sub 

    it shows record added successfully but when I open the table there is no record in there
    Last edited by neeshu30; Feb 13th, 2008 at 11:50 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width