Pages

Saturday, January 29, 2011

Configuring Sql 2005 for remote connecions

I added a server machine and created a small home network. I tried to connect but recieved the following error message

TITLE: Connect to Server
------------------------------

Cannot connect to GAURAV-PC.

------------------------------
ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

The instance name as specified in the error to check was very correct but the other point had some doubts whether my SQL server on server machine is configured for remote SQL connections or not in fact it was not....

This is the best guide I got to resolve this issue

http://support.microsoft.com/kb/914277

Microsoft SQL Server 2005 Error 5120 while attaching a Database

Recently I migrated from Windows XP to windows 7 and with that migrated my SQL server 2005 and my Visual Studio 2005.And of course my local databases.
I installed a fresh copy of windows 7 added Sql server 2005 to it. The problem occurred while I was attaching my old Databases to my fresh copy of Sql server.

The error was as follows

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

------------------------------

CREATE FILE encountered operating system error 5(error not found) while attempting to open or create the physical file 'F:\Learning Projects\Product Catalouge Application\catelouge\App_Data\Products.mdf'. (Microsoft SQL Server, Error: 5123)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4053&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------


At first it looked to be a big error but after a bit of research I found this issue to be the tiniest one I ever faced. Windows 7 security features were coming i between

Just start SQL Server in Administrator mode and you will come out of this error.
Let me know if you are still facing problems.

Tuesday, January 25, 2011

How to Configure ASP.Net Membership Providers on our own databases

By default, the required tables and stored procedures will be created in aspnetdb database.

To create the required tables and stored procedures for the SqlMemberShip provider in our own database, use a tool called as aspnet_regsql.exe packed with the ASP .Net Framework.

This tool is known by the Name ASP.Net Sql server registration tool.

To invoke this tool, type aspnet_Regsql in visual studio command prompt. It will open a wizard which will takes us through a series of steps where we can provide information about the database to create the required objects. Refer to the link below for more information

http://www.codedigest.com/FAQ/16-How-to-Configure-ASP-Net-Membership-Providers-to-Use-Our-Own-Database-.aspx