Tuesday, August 1, 2006

Insert NUll in value datatype like int,float in C#

Some times we need to make some data type to null. Like
in some cases like stored procedure in database.

We can do it in C# very easily. by just putting ?sign in'
the definition like below:

int? a;

that's it! you have created a value data type with null
database. If you don't supply a value to the int a then
it will remain null.

You can use this for any value data type like short,single,
double,long,decimal etc.

Happy Programming...
Share:

0 comments:

Post a Comment

Your feedback is very important to me. Please provide your feedback via putting comments.

About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews