Results 1 to 4 of 4

Thread: [2005] simple employee database program

  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.

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    Toronto, ON
    Posts
    1,093

    Re: [2005] simple employee database program

    Post the code you're using to try and insert into the database and we can tell you what the problem is.

  3. #3

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

    Re: [2005] simple employee database program

    posted the code tom thanks for advice

  4. #4

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

    Re: [2005] simple employee database program

    solved my problem guys thanks a lot for help

    my mistake was that I was opening the mdb file that was in the project directory which was left unchanged the updates were successfully made in the bin folder where visual basic made a copy of access database


    sorry for the inconvenience can someone please give me some example or link for search program where I can search records, for example people of one place and display on some datagrid, is there some tips or some external link here.

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