0

I've got SQL Sever 2008 R2 Express installed and am able to connect to it with SSMS using (local) and Windows Authentication.

However, when attempt to connect to it from an MVC Web Application running in Visual Studio 2012, I'm getting a network related exception when I try to open a connection to it.

This is my connection string:

connectionString="Server=.\SQLEXPRESS;Database=DavisFamily;UserID=adminuser;Password=******;"

I know this is set up correctly in other environments because other people have the app working just fine. I need my machine to be able to take this connection string and work with it.


So I just opened up Sql Server Configuration Manager to try to determine what my instance name is and the first thing I noticed is that when I click on the "SQL Server Servies" node of the "SQL Server Configuration Manager" tree structure, I'm getting an error message in the right side pane saying "The remote procedure call failed. [0x800706be]

Could this have anything to do with why I cannot connect to it from a web application? Bare in mind that I can connect to it directly using SSMS "(local)".

jdavis
  • 8,255
  • 14
  • 54
  • 62

3 Answers3

1

Go to SQL Server Configuration manager (under sql server configuration tools)

Open SQL server network configuration

Open protocols for your instance Make sure TCP/IP is enabled

Open tcp/ip properties, under IP All > Set the port number is 1433

Mosta
  • 868
  • 10
  • 23
0

maybe this help you. if I have gotten your meaning right...then: By using this code below you can access your server and database information. try... may this be helpful.

using Microsoft.SqlServer.Management.Smo;

Server server = new Server(".\SQLEXPRESS");
string Name = server.Databases[0].Name;//Also the Name of your Database 
server.Databases["DavisFamily"].Rename("NewName");//Rename

This code is in C#.But note that I guess maybe you cant use this Rename function for the database used by your current Application or website

Fuad
  • 231
  • 2
  • 10
  • Thanks for the response, but no, that's not what I mean. There is an instance of SQL Server running on my machine and I need to change the way that it is configured so that the code that currently works on other people's machines will work on mine. I think that it is possibly named something weird, so I'm asking how to go in and change it's name, not do it programatically in code. – jdavis May 09 '13 at 12:55
0

Ooh I see. For the first issue I think this help you: Now you are using adminuser for your login's username.you can set some properties fot it.

First log in your sql by using Sql Server Authentication username : sa and your password. then do this...

In your SQL Server Management Studio and left tree > Security > Logins > right click on adminuser and chose Properties > In the Server Roles check both public and sysadmin boxes > Then in User Mapping check the database DavisFamily that you are gonna use > then click Ok

try actions above...may these be helpful.

and for the second issue (error message "The remote procedure call failed. [0x800706be]). many reasons cause to this issue...have you another sqlserver installed with lower version on your Windows?If yes, look __ Sql Server Configuration Manager__ for that version. maybe this causes that issue...and also I read some where those who had this error , solved that by installing SQL Server 2008R2 service pack 1.
also you can check these links below :
[Link 1] : Remote Procedure call failed with sql server 2008 R2
[Link 2] : The remote procedure call failed

Community
  • 1
  • 1
Fuad
  • 231
  • 2
  • 10