|
-
Feb 13th, 2008, 11:42 AM
#1
Thread Starter
Lively Member
[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.Object, ByVal e As System.EventArgs) Handles 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.
-
Feb 13th, 2008, 11:46 AM
#2
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.
-
Feb 13th, 2008, 11:52 AM
#3
Thread Starter
Lively Member
Re: [2005] simple employee database program
posted the code tom thanks for advice
-
Feb 13th, 2008, 11:59 AM
#4
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|