Friday, February 15, 2008

Broken Capilary Urethra

Issue an alert following a postback

Programming web applications we often find ourselves in a position of wanting to communicate something to the user in a clear manner, drawing attention to a particular condition, or an error.

on Windows Forms Using messagebox the classic, comfortable, full of options and very practical.

ASP.NET pages instead we issue the javascript code to display an js alert with the message of the case.

then I wrote a handy function in the web pages that is very similar to the following: public void
 
MessageBoxScriptInject (string messageToShow)

{/ / I give him comatose with javascript ... String =
messageTranslated
messageToShow.Replace ("'", "\\ \\ '");
messareTranslated
messareTranslated.Replace = ("\\ n", "");
messareTranslated
messareTranslated.Replace = ("\\ r", "");

/ / Create the javascript

System.Text.StringBuilder js = new System.Text.StringBuilder ();
js.AppendLine (
window.alert ('"+
messareTranslated +"'); ");

/ / injected code in the page (syntax. NET 2.0)
this.ClientScript.RegisterStartupScript (
typeof (string),
Guid.NewGuid (). ToString (),
js.ToString (),
true);}

Friday, February 8, 2008

Mount And Blade 1.003trainer

Reindex an entire database on SQL server

Those who work on applications running on SQL Server database is large enough to identify early on that application is one of the critical time "spent" to access the database and that the response time of each query can change substantially if the indexes are created carefully.

After creating the DB and the indices, they tend to deteriorate with time, losing performance during logon.

A practical way to restore the performance of the indices is run on each database, perhaps as a schedule of nightlife, a script like this:

 
use Database;
GO exec
sp_msforeachtable 'dbcc DBREINDEX ("?") with NO_INFOMSGS';
GO