How to store date into the DB using datetimepicker

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2008
Posts: 22
Reputation: asmit1987 is an unknown quantity at this point 
Solved Threads: 0
asmit1987 asmit1987 is offline Offline
Newbie Poster

How to store date into the DB using datetimepicker

 
0
  #1
Sep 23rd, 2008
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...
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: How to store date into the DB using datetimepicker

 
0
  #2
Sep 23rd, 2008
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.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 22
Reputation: asmit1987 is an unknown quantity at this point 
Solved Threads: 0
asmit1987 asmit1987 is offline Offline
Newbie Poster

Re: How to store date into the DB using datetimepicker

 
0
  #3
Sep 25th, 2008
The code which u sent me is confusing but i think now i'll b able to do it
thnk u
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: How to store date into the DB using datetimepicker

 
0
  #4
Sep 25th, 2008
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.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 22
Reputation: asmit1987 is an unknown quantity at this point 
Solved Threads: 0
asmit1987 asmit1987 is offline Offline
Newbie Poster

Re: How to store date into the DB using datetimepicker

 
0
  #5
Sep 25th, 2008
well thank U for helping me out ....
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: How to store date into the DB using datetimepicker

 
0
  #6
Sep 26th, 2008
You're welcome
Don't forget to mark this thread as Solved
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC