Executing *.sql file form C#

Sometimes we need to run *.sql script from our application for installing data base. SqlCommand is not right for running installation script because installation script consists of DDL and GO command. Here we use smo library for executing *.sql script.

For doing above operation we need to add following references

Continue reading

My Short Note

Use Asp.net Session from Class Library (or Class Library Project)

Add First we need to add System.Web as a reference on our project.

System.Web.HttpContext.Current.Session[“MyVariable”];
System.Web.HttpContext.Current.Session(“MyVariable”);

Continue reading