C# Tutorial 23: How to use DateTimePicker and save date in Database

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ •

  • @DrSatti
    @DrSatti 11 років тому +2

    Your vision will make a great difference in the C Sharp world for a common programmer. Keep up the good work.

  • @mrj4082
    @mrj4082 3 роки тому

    Thank you. Very helpfull despite being almost 9 years old. Appreciate it man 👍

  • @sahack7322
    @sahack7322 9 років тому

    عااااااااااالی بود. مرررررررررررررررسی.
    it's very good. thank you so much sir. good luck.

  • @AlexMartinez-be2rh
    @AlexMartinez-be2rh 10 років тому +1

    Thaks very much sir, I was searching for this all day long, MSDN etc. and you have the answer.

  • @DeniseStack
    @DeniseStack 10 років тому +2

    It is easy to convert the date to the database format by using the Value of the date time object. dobdatettime.Value.ToString("yyyy-MM-dd") This works really well.

    • @NabeelHassanein
      @NabeelHassanein 10 років тому +1

      In VS C# 2012 Value Does not exists any more so it is done as follows
      dobdatettime.ToString("yyyy-MM-dd");
      Best Regards

    • @josi-iwnl-8920
      @josi-iwnl-8920 6 років тому

      thank god

  • @achibelukwando6986
    @achibelukwando6986 11 років тому

    learning a lot from your videos and still learning # keep up the good work guy

  • @miesen1of4
    @miesen1of4 4 роки тому

    Thank you , i this was helpfull for my class lab.

  • @naspiroh5152
    @naspiroh5152 2 роки тому

    Amazing tutorial.. Thanks

  • @TamillaS
    @TamillaS 10 років тому +1

    thank you very much!!! your tutorials are very useful!!!

  • @kriegswar6733
    @kriegswar6733 Рік тому

    thank you sir, you solved my problem here

  • @wilsonmateo6346
    @wilsonmateo6346 10 місяців тому

    thanks for the video mate it is not what i was looking for but great (what i am looking for is how to select the information of date from a datagridview, and make the datetimepicker show it) have tried a lot but nothing works

  • @emilioibanez4981
    @emilioibanez4981 2 роки тому

    Thankyou this helped a lot

  • @nessiraronialvarez1594
    @nessiraronialvarez1594 7 років тому

    Thank u very much :') you are beatiful programmer

  • @saurabhbelekar5431
    @saurabhbelekar5431 4 роки тому

    Thanks bhaii❤🙏

  • @sandarusampath7463
    @sandarusampath7463 2 роки тому

    Thanks a lot🔥

  • @diahdwilestari1052
    @diahdwilestari1052 5 років тому

    thank you, this video help me a lot

  • @سبحاناللهالحمدلله-ش2ر6ث

    Type of field (DOB) date or vchar??

  • @fatimashoaib4542
    @fatimashoaib4542 7 років тому

    such an amazing one! helped me a lot thank you so much

  • @nerodan1763
    @nerodan1763 11 років тому

    me han servido de mucho tus vídeos gracias, thanks for uploading your knowledge

  • @sivakumarsivakumar1304
    @sivakumarsivakumar1304 9 років тому

    the datetimepicker nice example

  • @eddyquintero91
    @eddyquintero91 7 років тому +2

    hello, What kind of data do you use in the date field of sql server?

  • @TheJoker0
    @TheJoker0 8 років тому +1

    Thank you, but I have a question
    when i try to insert date from Visual Basic Project to SQL Server 2008 with windows 7 I use '" & dateTipePiker.Text & "' it works when I use Windows 8 it don't work
    I tried '" & dateTipePiker.Value & "' and '" & dateTipePiker.Value.Date & "' and still dosen't work
    What should I do???

  • @HenryDubon23
    @HenryDubon23 6 років тому

    Gracias, saludo desde Honduras

  • @MIKEJMTR
    @MIKEJMTR 10 років тому

    Not working!
    just save 0000-00-00 00:00:00:00.000000
    "Incorrect date time value "12/11/14 0:00:00' for column "DOB" at row 1

  • @czajla
    @czajla 8 місяців тому

    spolier: property Format set Custom, this will activate property CustomFormat

  • @selimsacu6387
    @selimsacu6387 5 років тому

    Thank you very mach

  • @melvindelen2518
    @melvindelen2518 7 років тому

    Great tutorial. Thanks. Could you help me saving leap year in a database? Many thanks

  • @RadhaKrishna_777
    @RadhaKrishna_777 5 років тому

    Thank u 😊

  • @heshanvithanage7357
    @heshanvithanage7357 10 років тому +2

    Thanks :-) It's Work

  • @heraNbUdDHikA
    @heraNbUdDHikA 11 років тому +2

    what is the data type of DOB attribute in the database?

    • @ikadoxdell1695
      @ikadoxdell1695 10 років тому

      i also need to know that xD

    • @MrCoolbuddy143
      @MrCoolbuddy143 10 років тому +1

      Ikado Xdell Heran Buddhika The data type used in DOB is DATETIME.

  • @saqibsultan9410
    @saqibsultan9410 10 років тому +2

    Thnk's very much sir for this tutorial
    I want to asked one thing how can we add a remainder in c#, for example remainder for the date of birth.

  • @rushiayyappa165
    @rushiayyappa165 10 років тому

    how can i view the details again in those textboxes ,considering id as primary key,
    how to convert it while retrieving it from database?

  • @oddswish9524
    @oddswish9524 5 років тому

    Thanks bro.

  • @bloodymindedchild
    @bloodymindedchild 8 років тому +7

    "Date of butt" lol
    PS : I like your vids, keep doing !!!

  • @NabeelHassanein
    @NabeelHassanein 10 років тому

    DOB is an abbreviation Date Of Birth and accordingly represent Date field

  • @nicador100
    @nicador100 3 роки тому

    Thanks very much !!!!!!

  • @EkambaramPalabindela
    @EkambaramPalabindela 10 років тому

    Thank You sir....

  • @bereshdo
    @bereshdo 11 років тому

    that's good will be succssed

  • @snehanaidu5532
    @snehanaidu5532 5 років тому

    When i click on date timer then my calendar is not showing that years and months why? Just showing today's date and that same format but other years date are missing what should i do? Please answer

  • @zwggra
    @zwggra 11 років тому

    BE CAREFULL WHO EVER DO THIS LOAD DATABASE BUTTON DOESNT WORK WITH DATES YOU MUST USE THIS ON LOAD BUTTON :
    "server=localhost;User Id=root;password=kalaok123;Persist Security Info=True;database=database; Convert Zero Datetime=True"

  • @hakanyldz9013
    @hakanyldz9013 6 років тому

    thanks bro

  • @mohammadtaghipahlavan940
    @mohammadtaghipahlavan940 4 роки тому

    ok what if i want to read that date i put in DOB in to my app?

  • @ashrafzaky
    @ashrafzaky 4 роки тому

    when i was trying to store the Picked Date it always send 00 month becuse my formate was dd/mm/yyyy, but it fixed when i changed it to dd/MM/yyyy ... why i must wirte MM not mm ? thanks in advance.

  • @BrunoSouza-jy4rk
    @BrunoSouza-jy4rk 8 років тому

    help a lot !!!

  • @shibleekhan101
    @shibleekhan101 11 років тому

    What can i do if i am not using the the MySQL server. i am using northwind database sample and i add column of DOB in it. when i use the datetimepicker i got the error massage (string or binary data would be truncated.the statement has been terminated.) Can any one help me? Thanks

  • @gdragon448
    @gdragon448 6 років тому +1

    what is data type in sql server of date?

  • @skybladeyou
    @skybladeyou 8 років тому

    hi may i know how u make the login page?

  • @spaceredx
    @spaceredx 2 роки тому

    Gracias bro

  • @coocoonuut49
    @coocoonuut49 9 років тому

    thx so much!!!

  • @JunLee000
    @JunLee000 8 років тому

    how to write code on dateTimePicker if you want to Display selected row from datagridview to TextBox click event
    dateTimePicker1.Text = row.Cells["dob"].Value.ToString(); it has error if I try to code like this

  • @joannamaevillamor4270
    @joannamaevillamor4270 4 роки тому

    How about the code for radio button?

  • @SrVentor
    @SrVentor 6 років тому

    Thanks !!!!

  • @redcardfordie
    @redcardfordie 8 років тому

    thank u

  • @ribvicky
    @ribvicky 8 років тому +2

    Use parametrized query :-/

  • @abobakersdeeg
    @abobakersdeeg 7 років тому

    iwant using datetimepaker in sql server iceart column in db sql server type date in form iused datetime packer values datetimepacker1.text or value is errror

  • @fabiogoncalves3677
    @fabiogoncalves3677 9 років тому

    Hello
    i am using sql server 2012 so can u tell me what i am suppose to wirite when u write("datasource=localhost;port=3306;username=rot;password=root";)
    i dont know :3 help

  • @abobakersdeeg
    @abobakersdeeg 7 років тому

    I want a distinguished institute in c# asp.mvc , India. Please detail the title. I will come from outside India

  • @TormentaJohnny
    @TormentaJohnny 10 років тому

    somebody knows can i get a function that returns a inner join queery results using tree layer Architecture. I'm developing and studying with Murach Adonet Book, but i can´t find it.

  • @a-maxlee5763
    @a-maxlee5763 11 років тому

    May I ask that the data type of attribute "DOB" is what? time or nchar(10)?
    Can any one reply me...Thank you
    ~~

  • @maran9178
    @maran9178 7 років тому

    Awesome

  • @kiolerond8926
    @kiolerond8926 8 років тому

    can i have a copy of your codes?

  • @manigopal
    @manigopal 11 років тому

    how to use this in C# in SQL server 2008

  • @abdallahahmed3981
    @abdallahahmed3981 9 років тому

    please could anybody tell me how to insert date from date and time picker in MS Access DB ?

    • @vantastic
      @vantastic 9 років тому +1

      Abdallah Ahmed This is a C# tutorial dude, however I'm familiar with VBA so I can hopefully help you. You need to format the value within DatePicker to suit the destination database requirement. If MySql, then the following code will work:
      dim MySqlDate as String
      MySqlDate = format(dtpicker.value,"yyyy-mm-dd HH:nn:ss") 'You can remove the time formats if you just need the date itself.
      then include that string variable into your SQL string and use the runsql function. Something like:
      Dim MyQuery as String
      MyQuery = "INSERT into tablename (datefield) VALUES ('" & MySqlDate & "');"
      DoCmd.RunSql(MyQuery)
      Not sure if this is what you're after though.

  • @kishorkabadi6551
    @kishorkabadi6551 6 років тому

    how to change language of DateTimePicker to Rusian in c#.net

  • @cameronjordan897
    @cameronjordan897 5 років тому

    I lov u

  • @guleye
    @guleye 5 років тому

    do something for your fan

  • @m0ro0n
    @m0ro0n 8 років тому

    can you send for ,me the source please

  • @hydrohutechhcm
    @hydrohutechhcm 11 років тому

    i have a problem but it's done now

  • @gian-lucanardini9706
    @gian-lucanardini9706 9 років тому

    mine is creating multiple names

  • @wunnell
    @wunnell 6 років тому

    Any tutorial that teaches people to use string concatenation rather than parameters when saving to a database is a bad tutorial.

  • @youdodle
    @youdodle 9 років тому

    abudalalalalalala

  • @hebermendozacaballero267
    @hebermendozacaballero267 8 років тому

    porque si es aleman el tipo que explica el video, lo programa en inglés, no les basto con perder la guerra? jajaja

  • @ishanmadushanka3709
    @ishanmadushanka3709 Рік тому

    thank you bro

  • @ShadowDared
    @ShadowDared 5 років тому

    thanks you very much