Friday, October 2, 2009

SQL 2005 Configuring SQL Job to send email notification if it failed.

SQL 2005 Configuring SQL Job to send email notification if it failed.
This are the simple steps to enable it.
1) Run SQL Server Surface Area Configuration - > Surface Area Configuration for features ->
Select Database Mail - > Check Enable Database mail stored procedures.
2) Open SQL Management Studio - > Management - > Database mail - > Configure SMTP Settings.
3) Go to SQL Server Agent - > Operators - > Create New Operator
4) Go to SQL Job - > In the Notifications, Check email and select the Operator. You can either
select the option to send notification if job fails / succeeds/ completed.
Lastly, don't forget to restart the SQL Agent.

Thursday, October 1, 2009

Open New Window from asp button click

3. Open New Window using ScriptManager
Just on button click, we can register the script to open new window. Let me show this on button click event hander.
protected void btnClick_Click(object sender, EventArgs e)
{
string url = "MyNewPage.aspx?ID=1&cat=test";
string fullURL = "window.open('" + url + "', '_blank', 'height=500,width=800,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
}

Here we don’t need to add attribute to the button. This just will open new window with the URL specified. And please also note the properties of the new pop-up window.