943,974 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 2687
  • VB.NET RSS
Sep 23rd, 2008
0

How to store date into the DB using datetimepicker

Expand Post »
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...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
asmit1987 is offline Offline
22 posts
since Sep 2008
Sep 23rd, 2008
0

Re: How to store date into the DB using datetimepicker

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 & "')"
Last edited by Jx_Man; Sep 23rd, 2008 at 5:15 pm.
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,143 posts
since Nov 2007
Sep 25th, 2008
0

Re: How to store date into the DB using datetimepicker

The code which u sent me is confusing but i think now i'll b able to do it
thnk u
Reputation Points: 10
Solved Threads: 0
Newbie Poster
asmit1987 is offline Offline
22 posts
since Sep 2008
Sep 25th, 2008
0

Re: How to store date into the DB using datetimepicker

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 & "')"
Last edited by Jx_Man; Sep 25th, 2008 at 4:44 am.
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,143 posts
since Nov 2007
Sep 25th, 2008
0

Re: How to store date into the DB using datetimepicker

well thank U for helping me out ....
Reputation Points: 10
Solved Threads: 0
Newbie Poster
asmit1987 is offline Offline
22 posts
since Sep 2008
Sep 26th, 2008
0

Re: How to store date into the DB using datetimepicker

You're welcome
Don't forget to mark this thread as Solved
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,143 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Problems retrieving from database
Next Thread in VB.NET Forum Timeline: how to store image in datbase





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC