Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

How can I store a to a Text Field in SQL Server Database?

$
0
0

Ok...So I have these text fields on my C# Form. I am initializing a GlobalVariable for each ...

GlobalVariableClass.GlobalStringText = null;

If nothing is changed in that text field, I then use the GlobalVariable to Insert a value to SQL Server. But it is storing as a <space> rather than a <NULL>. 

I know this sounds stupid, but the only way I can get it to store as a <NULL> is to default its value to some real arbitrary value, like "---XYZ+++ABC" and then handle that within an IIF to store a NULL if it is valued as such.

There MUST be a better way.

Can someone please help me out?

Thanks for your review and am hopeful for a reply.

PSULionRP


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>