Friday, March 16, 2012

import failed because of FK Constraint

This is what my DBA friend told me to do:

Execute this before download data

ALTER TABLE [dbo].[TableName] NOCHECK CONSTRAINT ALL;

After downloading data remember to execute this.

ALTER TABLE [dbo].[TableName] CHECK CONSTRAINT ALL;

Hope it's useful for you also :D

Thursday, March 15, 2012

URL Rewriting in ASP.NET

will try on this when I got time :)
http://msdn.microsoft.com/en-us/library/ms972974.aspx

Tuesday, March 13, 2012

HTTP REFERER null in C#

I am trying using http referer in C# to detect another website that calls my site.

Trying but it's not working, try googling, but they all suggest using all these:

- Request.UrlReferrer
- HttpContext.Current.Request.ServerVariables["HTTP_REFERER"]

but still resulting in null.

ask my friend to try, and he succeeded.

try to check the difference in the code, and finally... got the problem...

It's not working when redirect from PAGE_LOAD because I think on page load the header is not loaded yet, so if you directly redirect the page, it will contain NULL.
He's using a button to redirect, no wonder it's working, lol

Update (20120412):
It is also not working from HTTPS to HTTP site :)

dang! a big problem for me..