Posts

ASP.NET Session States in SQL Server Mode

Image
ASP.NET Session States in SQL Server Mode  1. Run --> Cmd press enter 2. on DOS screen , type "C:\Windows\Microsoft.NET\Framework64\v4.0.30319" press enter 3. type "aspnet_regsql.exe -S  Test_DB -U sa -P bajaj@123 -ssadd -sstype p" press enter Then ASP State is in Database created. Then Go to web application and define the session state mode in web.config <system.web> <sessionState mode="SQLServer" timeout="30" sqlConnectionString="Data Source=192.168.68.10; User ID=sa;Password=Test@123;" cookieless="false" /> </system.web>

How to import / export excel file using open xml

Download " DocumentFormat.OpenXml.dll " from website and write following code protected void btnimport_Click( object sender, EventArgs e)     {         try         {             DataTable dt = new DataTable ();             if (fu_File.PostedFile != null )             {                 string strtimeStamp = string .Empty;                 strtimeStamp = System. DateTime .Now.Ticks.ToString();                 string fileName = Server.MapPath( "~/UploadFile/" ) + strtimeStamp + "_" + fu_...