Forums - C# Corner

Forum guidelines
stevan

stevan

  • 1.4k
  • 1
  • 5.1k

How To Insert the value of Datetimepicker in SQL Database

Apr 22 2013 4:00 PM

Hello, I'm having a problem with inserting date from datetimepicker into sql. The thing is - I don't know how to do it.

I'm using WPF with LINQ to sql database connection.

This is how it should work :

In the button Insert I want to put name, surname and date of birth into sql database.

So I have

Person p=new Person();

p.Name=nameTextBox.Text.Trim();

p.surName=surNameTextBox.Text.Trim();

p.dateOfBirth= // I don't know how

Thanks in advance.


Answers (2)

File APIs for .NET – 25% off Aspose.Total
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more! Use coupon code HOL2016PSB