All You need to Know about Static

In this post we will discuss all about Static Keyword. Static in general means something which is fixed, singular, stable, steady and unchanged.

In C# Static keyword can be used with following:

  • Variables/Fields
  • Classes
  • Constructors
  • Methods
  • Properties

In this article we will cover each of them one by one. Additionally this article also tackles various misconceptions or questions regarding static which can help you in understanding the concept a bit better. Continue reading

How to store result of a stored procedure in a table variable (Sql Server)

Table variables are very useful to store intermediate results in between a dynamic query or a large query whose results need to be fed into another sql query. Hence there are many times, when we encounter a situation where we need to store result of a stored procedure execution into a table variable to be used further by another query.
Let’s see how we can do that. For this first I have Created some sample table & Data. Continue reading

How to create a collapsible Fieldset using JQuery & css

We can create a collapsible fieldset very easily using Jquery & css. Lets see how to achieve same :
To achieve same a Jquery function is attached to click event of Legend, and whenever legend is clicked,
a specific css class is toggled on Div present inside fieldset where all fieldset content resides.
Css class: Active whenever is attached to div then legend text is changed to Collapse me else changed to Expand me.

Continue reading

Write commands to serial port from c# application

In one of my projects I needed to use a DEVICE which used serial port to communicate with any other application. Hence from my C# application I had to somehow send commands to that device in order to operate it.
Now that device used to run on COM Port i.e. Serial Port. Serial port understand commands in ascii format or byte arrays.
This particular device used to connect to serial port through ASCII Commands. Lets see how we can achieve this.

Continue reading