Reputation: 83
I have "duration" Field in SQL table with type "Bigint", inside SQL procedure, we convert it into decimal when we divide it by 3600 , Now when we get Datatable in c# with this Store procedure, we get this duration field with datatype decimal .
Now we have one another field "Price" in SQL table with type "Money" and this field get converted into "decimal" type by .net when we get datatable from store procedure means "SQL money type is equivalent to .net decimal type " .
Now inside code, we have some logic which works on bases of datatype of table fields, So we need to run this logic for only "Money" type fields, Now I got stuck at this point, how can I distinguish b/w these "duration" and "Price" field because in C# datatable they both are in "Decimal" datatype .
Now according me whether I need to change the conversion of duration by decimal to float in store procedure or something else, Please suggest me .
Upvotes: 0
Views: 1755
Reputation: 151586
Change the code that looks at data types to look at column names instead.
Upvotes: 3