سؤال

I have an sp with a parameter of smalldatetime datatype. I'm calling my SP through OleDbConnection in my C# code. using OleDbConnection is a requirement so don't answer to change my connection type to SqlConection.

Now my problem is I cannot pass the parameter of type smalldatetime to the sp because OleDbDataType don't have smalldatetime datatype. What's the best DataType to use? or any suggestions? Except changing my connection type to SqlConnection.

هل كانت مفيدة؟

المحلول

OleDbType.DBTimeStamp

it will resolve to the System.DateTime but when you store the data in the database millisconds will not be stored.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top