Can't store the values I get from my temperature in the database.

tuxduino:
The OP error is this (please reread the first post):

Not necessarily.

It could be that the OP's real error is that he is taking the wrong approach, trying to re-invent the wheel, and ending up with a square one.

Needless to say, he has every right to bash his head against a brick wall for the intellectual exercise, but there is no suggestion that that is his intent. The intent could be to actually solve the problem, and the problem is reasonably clear (please re-read the title of the post, large orange letters).

I have no idea about what OP is trying to do in C# but, as far as this forum is concerned, he is like me, a newbie by definition, and both of us have been faced with the same problem. The principle difference between us is that I can send my temperatures to a database, and he can't. Hence my post.

Hopefully OP will find it a useful approach, he might even find it a blessed relief........