Saturday, December 29, 2012

How to convert SQL Server's timestamp column to datetime?

No. You can't
SQL Server's timestamp just an incrementing number and does not preserve a date or a time.

How to get client IP address?

How to get client IP address?
HttpContext.Request.UserHostAddress

How to fix "The name does not exist in the current context" in ASP.NET webforms?

Delete all of content in designer.cs, let Visual Studio generate again.

10 Web Predictions for 2012: the Results!

http://www.sitepoint.com/2012-web-prediction-results/

Wednesday, December 26, 2012

Why session id changes every time in ASP.NET?

Why session id changes every time in ASP.NET?
protected void Session_Start(Object sender, EventArgs e) 
{
    Session["init"] = 0;
}
http://msdn.microsoft.com/en-ca/library/system.web.sessionstate.httpsessionstate.sessionid.aspx
a new session ID is generated for each page request until the session object is accessed. If your application requires a static session ID for the entire session, you can either implement the Session_Start method in the application's Global.asax file and store data in the Session object to fix the session ID, or you can use code in another part of your application to explicitly store data in the Session object.