I am trying to update my datasource with a decimal value. I know from my own deductive reasoning that the fault probable lies in the following code
.Add("@VideoDetailID", SqlDbType.Int, 4, "VideoDetailID").SourceVersion = DataRowVersion.Original
.Add("@VideoTitle ", SqlDbType.VarChar, 500, "VideoTitle")
.Add("@VideoDuration", SqlDbType.Decimal, 9, "VideoDuration") '....................Specifically here!
.Add("@VideoURL", SqlDbType.VarChar, 1000, "VideoURL")
.Add("@GlobalAccessID", SqlDbType.Int, 4, "GlobalAccessID")
The problem I am having is that if I try and insert 2.45 what actually gets inserted is 2.00 so I need to know how to get round this problem.
I know the database datatype is set to decimal and it accepts decimals when inserted manually. My dataset also successfully holds the correct data but when I try and save the data, eg when I run the code above something happens and it does not insert the digits after the decimal place.
I have tried
.Add("@VideoDuration", SqlDbType.Decimal, 9,2, "VideoDuration")
But this does not work