I'm yet to see the "full" explanation I asked for. Are you saying that you want to get the last record from the database or from the data you already have? Is this ID you're generating the PK for the table or are you using an auto-generated value for that?

As for inserting a date into a database, it's no different to inserting any other value. You use parameters for all data, so the data type is irrelevant. Follow Blog link in my signature and check out my ADO.NET Parameters post for more info.