Try out one of the following,
1)Add the sql server port to the connection string:
Server=YourSQLSRVR,10000;Database=YourDatabase;User ID=User;Password=?????????
2)
1. Your SQl Browser is off
2. Protocols under SQLServer Configuration Manager > SQL Server 2005 Network Configuration > Protocols for SQL Express like TCP/IP, Named Pipes are disabled.
Resolution.
Just Start SQL Browser.
Enable the Protocols.
Restart SQL Express service.
3)your pc name\SQLEXPRESS
u copy this name and paste it in the web config file of your asp.net framework as
<connectionStrings>
<add name="this name is as your wish" connectionString="server=your pc name\\SQLEXPRESS; catalog= your database name;SSPI=true; providerName="System.Data.SqlClient" "/>
</connectionString>
this section comes under <appSettings/>
then u call this string connection in ur aspx.cs code file as
string connectionString =
WebConfigurationManager.ConnectionStrings["this name is as your wish"].ConnectionString;
SqlConnection con = new SqlConnection(connectionString);
then u open the connection and use for your purpose and make sure that u close the connection after use
I hope this might resolve the problem