I need to store date from my application in to my database which created in MS Access now i use datetimepicker in my application created in VB.net 03 what shuold be the necessary code required for it plz help me with code snippet...

Recommended Answers

All 5 Replies

the red line is how to use datetimepicker :

cmdPendidikan1.CommandText = "INSERT INTO Pendidikan(IdPendidikan, Nis, Lulusan, LamaBelajar,SekolahAsal,Alasan,Kelas,Tgl) VALUES('" & Trim(IdPendidikan.Text) & "','" & Trim(cmbNis.SelectedItem) & "','" & Trim(txtLulusanDari.Text) & "','" & Trim(txtLamaBelajar.Text) & "','" & Trim(txtSekAsal.Text) & "','" & Trim(txtAlasan.Text) & "','" & Trim(cmbKelas.SelectedItem) & "','" & dtTglDiterima.Value.ToShortDateString & "')"

The code which u sent me is confusing but i think now i'll b able to do it
thnk u

don't be confused. Just focus in the red line, that is how to get value from datetimepicker.
this is new example :

cmdTest.CommandText = "INSERT INTO Book(Id, Name, BirthDate) VALUES('" & Trim(txtId.Text) & "','" & Trim(txtName.Text) & "','" & dtBirthDate.Value.ToShortDateString & "')"

well thank U for helping me out ....

You're welcome
Don't forget to mark this thread as Solved :)

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.