Thursday, March 28, 2013
Wednesday, March 27, 2013
How to deal with error "System.Data.MetadataException: Unable to load the specified metadata resource" when move edmx entity file to another project?
Cause: the res:// path changed. Need to be modified
Change connection for edmx file from
metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;
To
metadata=res://projectname/foldername.csdl|res://*/Model1.ssdl|res://*/Model1.msl;
Change connection for edmx file from
metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;
To
metadata=res://projectname/foldername.csdl|res://*/Model1.ssdl|res://*/Model1.msl;
Tuesday, March 26, 2013
Monday, March 25, 2013
What is constructor instruction in C#?
The red color part is intructing to call another contructor.
class ListNode
{
private object data;
private ListNode next;
public ListNode(object dataValue) : this(dataValue, null)
{
}
public ListNode(object dataValue, ListNode nextNode)
{
data = dataValue;
next = nextNode;
}
}
class ListNode
{
private object data;
private ListNode next;
public ListNode(object dataValue) : this(dataValue, null)
{
}
public ListNode(object dataValue, ListNode nextNode)
{
data = dataValue;
next = nextNode;
}
}
Friday, March 22, 2013
What is exception code: 0xe053534f
Mean: soft stack overflow
If hapends in IIS server, check code related to the permision
If hapends in IIS server, check code related to the permision
Thursday, March 21, 2013
Wednesday, March 20, 2013
Hacking the HTML a tag in 100 characters
http://bilaw.al/2013/03/17/hacking-the-a-tag-in-100-characters.html
// Uncompressed var links = document.links; for(i in links) { links[i].onclick = function(){ this.href = 'http://bit.ly/141nisR'; }; } // Compressed (was 100; now 67 characters exc. the link) // Thanks to sgoel from HN o=document.links;for(i in o){o[i].onclick=function(){this.href='//bit.ly/141nisR'}}
Tuesday, March 19, 2013
Monday, March 18, 2013
Why session expired so fast in ASP.NET?
A lot of reasons, check following list for detail:
http://blogs.msdn.com/b/johan/archive/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle.aspx
http://blogs.msdn.com/b/johan/archive/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle.aspx
Thursday, March 14, 2013
How to update tables by inner join in SQL
update L
set l.Text ='something'
from [aTable] a
inner join [bTable] b on a.Id = b.aId
where a.id = 1
set l.Text ='something'
from [aTable] a
inner join [bTable] b on a.Id = b.aId
where a.id = 1
Tuesday, March 12, 2013
How to read cookie value in ASP.NET MVC razor view?
@Request.Cookies["cookiename"].Value
@Response.Cookies["cookiename"].Value
@Response.Cookies["cookiename"].Value
Monday, March 11, 2013
ASP.NET Web API REST Security Basic
http://www.jamiekurtz.com/2013/01/14/asp-net-web-api-security-basics/
Thursday, March 7, 2013
How to keep ASP.NET application "alive" ?
There is one event call, Application_End in Global.asax. It happens when IIS application pool is recycled or the application itself is unloaded.
So add one call to self website to make application running again.
So add one call to self website to make application running again.
protected void Application_End(object sender, EventArgs e) { System.Threading.Thread.Sleep(1000); try { WebClient http = new WebClient(); string Result = http.DownloadString(yourwebsiteurl); } catch (Exception ex) { string Message = ex.Message; } }
Wednesday, March 6, 2013
Tuesday, March 5, 2013
How to get started on “Service Unavailable 503” error in ASP.NET?
In IIS Server application pool default settings,
If application crashed 5 times in 5 minutes, IIS will return 503 error.
Check log to get detail of errors
If application crashed 5 times in 5 minutes, IIS will return 503 error.
Check log to get detail of errors
Monday, March 4, 2013
How to solve JScript Debugger– “Unable to attach the process. Another debugger might be attached to the process"
Visual Studio => Tools => Detach all
Friday, March 1, 2013
How to reset Orchard admin password from database?
update [Orchard_Users_UserPartRecord] SET [Password] ='password', [PasswordFormat] ='Clear' where [UserName] ='admin'
Subscribe to:
Posts (Atom)