I am using SQLExpress and I have a table called Library. I have a BO call Library1. I created a method called FillByDate.
The column on my table that I want to look at is media_date it is of DataType DateTime.
my SQL is: "Select * from library where Media_date = @ldDate"
ldDate = cdate("10/15/2006")
I am also new to Sql Server so My Question is what date conversion function do I need to get my parameter and my Table.DateTime Field to work.
PS, I don't know what the actual time would be...Just the Date
If you're setting the value in your default values, you can do this instead:
me.myfield = DateTime.Now.Date
Accessing the .Date property of a DateTime will return the date with the time truncated (alternatively, you could use the .TimeOfDay property to access just the time portion).
However, if you're setting the property in other ways, you can customize the property in the BOMapper to set the data within the business object to the .Date of the value passed.