"None can stop the rising sun, clouds can hide for a while........" -Ravi

Thursday, August 27, 2009

Using windows MessageBox in ASP.NET

I have seen in the forums, lot of people are asking for using Windows MessageBox in ASP.NET. It's pretty simple. Just you need to Add System.Windows.Forms namespace to references. Follow these steps:

1) Right Click on References in your solution explorer
2) Click on Add References. Add References window will be open
3) Under .NET tab select System.Windows.Forms, Click Ok. Now it added to your reference library
4) Import the namespace System.Windows.Forms in your page
C#: using System.Windows.Forms;
VB.NET: Import System.Windows.Forms
5) Now you can use MessageBox.Show();

Thursday, August 20, 2009

Ceating Indexes on views in SQL 2005

When I was creating Index on view, I got the following error.
"Cannot create index on view 'v_testview' because the view is not schema bound. (Microsoft SQL Server, Error: 1939)". Following link helped me to figure out the solution.


It may hellpfull to you also..

Saturday, August 8, 2009

Restore existing database in SQL 2005

1)Open Microsoft SQL Server Studio, Login with your SQL Credentials or using Windows Authentication mode.
2)Create New Database with name “DatabaseName”, Set path for MDF and LDF files on your local computer.
3) Right click on the created databse("DatabaseName") in Object Browser Window and select Task->Restore->Database option. You will get restore database wizard opened.
4) On General Menu, select radio option of “From Device”, then select backup file from browse file option.
5) After successfully selection of Backup file, Goto Options menu from left navigation pane and Mark “Overwrite Existing Database” to true.
6) Click OK

If you want to create database diagrams for restored database, you will get the following error.

Error: Database Diagram Support Objects cann't be installed because this database doesn't have a valid owner.

Solution: By default restored database consider system login ID as database owner. We need to change the database ownership manually, back to the owner that originally created the database when diagrams created. To accomplish this run the following query in SQL query analyzer

--Replace "DatabaseName" with your database name
USE DatabaseName--(change this Database name)

--Following query will change owner name
EXEC sp_changedbowner 'sa';

You can look at the current wner to the database by running the following query

EXEC sp_helpdb;

Debug problem in older version Visual Studio(VS2003 & VS2005) with IE 8

I had done lot of research to fix my debug problem in Visual Studio 2005. Finally, I got the solution.

Problem: Debug is not working for VS 2005 with IE8

  1. Go to Start
  2. Select Run
  3. Enter RegEdit (this opens Registry Editor Window)
  4. Go Thru HKEY_LOCALMACHINE\SOFTWARE\Microsoft\Internet Explorer\Main
  5. Check for the key TabProcGrowth, if you haven't find add new DWORD with the name TabProcGrowth
  6. Set the value to 0

Reason: This problem is because of opening of multiple instances in IE8 browser. IE8 has a feature called "Loosely-Coupled Internet Explorer (LCIE)", which isolates the Internet Explorer frame and its tabs into separate processes. Because of this seperate process between IE frame and Tabs, Older versions of VS debuggers are getting confused to connect to the exact process.

Hope this will fix your problem.