Hi all.
I am trying to add a record into the database wothout much success. sometimes it works and sometimes it returns error "overflow exception unhandled"
And even the database is not all the time updated.
How do you add the Datatimepicker value into the database...?

Will really appreciate help on this.
Pl check my code..

        frmedit.AlumniTBLTableAdapter.Insert(Me.TextBox2.Text, _
        Me.TextBox3.Text, DateTimePicker1.Value.ToShortDateString, Me.TextBox5.Text, _
        Me.TextBox6.Text, DateTimePicker2.Value.ToShortDateString, DateTimePicker3.Value.ToShortDateString, _
        Me.TextBox9.Text, Me.TextBox10.Text, Me.TextBox11.Text, _
        Me.TextBox12.Text, Me.TextBox13.Text)

        MsgBox("Records added")

I'm using VS 2008 and MsAccess as my database connected through the database connection wizard

Recommended Answers

All 2 Replies

Incorrect date formats will result in an error. Try the following -

'.... code....
DateValue('" & DateTimePicker1.Value & "'",

Thanks, wl sure try this...

one more thing...why is my MsAccess database not retaining the datas added few minutes earlier...just dissapears after sometime after datas been added at runtime...???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.