473,583 Members | 3,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Web.Serv ices.Protocols. SoapException: Server was unable to process request. ---> System.Data.Sql Client.SqlExcep tion: An attempt to attach an auto-named database for file

This is the exception that I get when i create a webserivce obj and
call. The error comes on the webmethod call, when it opens a
connection to the db.

How do I fix it? What is the solution to this?

System.Web.Serv ices.Protocols. SoapException: Server was unable to
process request. ---System.Data.Sql Client.SqlExcep tion: An attempt
to attach an auto-named database for file g:\inetpub\wwwr oot
\BankingService \App_Data\Banki ngDb.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC share.

at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection )
at
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj)
at
System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean
enlistOK)
at
System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
owningObject, SqlConnectionSt ring connectionOptio ns, String
newPassword, Boolean redirectedUserI nstance)
at
System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserI nstance)
at
System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
DbConnection owningConnectio n)
at
System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options)
at
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n)
at
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry)
at System.Data.Sql Client.SqlConne ction.Open()
at BankingService. CheckPincode(St ring Pincode) in g:\Inetpub\wwwr oot
\BankingService \App_Code\Servi ce.cs:line 123

May 29 '07 #1
3 24228
The MDF file BankingDb, does a database with that name already exist on
the server you are trying to run this off of?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"weird0" <am********@gma il.comwrote in message
news:11******** **************@ q75g2000hsh.goo glegroups.com.. .
This is the exception that I get when i create a webserivce obj and
call. The error comes on the webmethod call, when it opens a
connection to the db.

How do I fix it? What is the solution to this?

System.Web.Serv ices.Protocols. SoapException: Server was unable to
process request. ---System.Data.Sql Client.SqlExcep tion: An attempt
to attach an auto-named database for file g:\inetpub\wwwr oot
\BankingService \App_Data\Banki ngDb.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC share.

at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection )
at
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj)
at
System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean
enlistOK)
at
System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
owningObject, SqlConnectionSt ring connectionOptio ns, String
newPassword, Boolean redirectedUserI nstance)
at
System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserI nstance)
at
System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
DbConnection owningConnectio n)
at
System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options)
at
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n)
at
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry)
at System.Data.Sql Client.SqlConne ction.Open()
at BankingService. CheckPincode(St ring Pincode) in g:\Inetpub\wwwr oot
\BankingService \App_Code\Servi ce.cs:line 123

May 29 '07 #2
It looks like you are attempting to do an auto-attach of a SQLEXPRESS
database file. Normally this only works in development mode on the same
machine.
Instead, attach the database "the big boy way" to Sql Server on the remote
machine and use a "regular" connection string like:
server=machineN ame;database=yo urdbname;uid=wh atever;pwd=pass ;

Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"weird0" wrote:
This is the exception that I get when i create a webserivce obj and
call. The error comes on the webmethod call, when it opens a
connection to the db.

How do I fix it? What is the solution to this?

System.Web.Serv ices.Protocols. SoapException: Server was unable to
process request. ---System.Data.Sql Client.SqlExcep tion: An attempt
to attach an auto-named database for file g:\inetpub\wwwr oot
\BankingService \App_Data\Banki ngDb.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC share.

at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection )
at
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj)
at
System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean
enlistOK)
at
System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
owningObject, SqlConnectionSt ring connectionOptio ns, String
newPassword, Boolean redirectedUserI nstance)
at
System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserI nstance)
at
System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
DbConnection owningConnectio n)
at
System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options)
at
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject)
at
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n)
at
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry)
at System.Data.Sql Client.SqlConne ction.Open()
at BankingService. CheckPincode(St ring Pincode) in g:\Inetpub\wwwr oot
\BankingService \App_Code\Servi ce.cs:line 123

May 29 '07 #3
Hi! Like you pointed a different format for the connectionstrin g that
i am using to run the webservice locally...

server=machineN ame;database=yo urdbname;uid=wh atever;pwd=pass ;

Here is the connectionstrin g that i am using inside the code both for
client of webservice and website for asp.net location. And it does not
work for webserivce:

public static string connectionStrin g = @"Data .
\SQLEXPRESS;Att achDbFilename=| DataDirectory|\ BankingDb.mdf;I ntegrated
Security=True;U ser Instance=True";

What should be my connectionstrin g coz i dont think i have a username
and password for my db. Here is what i guess
it should be what you told? Is it correct? Can i just write
DataDirectory or do I have to specify the exact directory where the
database lies like on the desktop?

public static string connectionStrin g = @"server=localh ost;server=g:
\Documents and Setting\s2188\D esktop\App_Data
\BankingDb.mdf; User Instance=True";
May 30 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4091
by: Ersin Gençtürk | last post by:
we are getting : System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior...
1
2909
by: HK | last post by:
I just moved an ASP.NET application to a new web server at a different location of ours. The SQL Server machine was moved to that new location at the same time as the web site DNS was pointed to the new server. Suddenly I'm getting lots of intermittent errors of this type. The switch/hub/repeater that routes the traffic at the new...
3
4987
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function...
0
4911
by: SherriK | last post by:
I'm hoping someone may have a solution to this problem. I have several web part page views that are used in a sharepoint (WSS) site. The web apps that are used in the sharepoint web part views use web services that reside on the same server. The first time the sharepoint page is loaded all of the web part views are successfully loaded with...
1
7206
by: Florencio Laso | last post by:
Hola to all: We have created a service web that works perfectly while is invoked in the localhost of the machine of development or from the IE of the servant where we have published it. Nevertheless, if we create an application client who does a call to the same one, it returns the following mistake to us: System. Web. Services. Protocols....
1
13033
by: weird0 | last post by:
System.Data.SqlClient.SqlException: An attempt to attach an auto- named database for file "Location" failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. I am getting the above the exception while connecting to the db and i have written a web-service... i.e. a webmethod. What...
0
1324
by: sara77 | last post by:
I have a web service that receives an xml Node and xpath and should send back the matching node. My code works fine, the only problem is when the matching node is an XmlAttribute then it throws the following exception: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException:...
1
2786
by: thithi | last post by:
Please help me " System.Data.SqlClient.SqlException: Prepared statement '(@Name varchar(100),@Describes varchar(100),@Money char(10))Upda' expects parameter @Describes, which was not supplied. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at...
0
1603
by: Vijyeta | last post by:
hi Guys, I am using MediaBin as an asset repository. when I am trying to update the asset metadata, I am getting the following exception : System.Web.Services.Protocols.SoapException: Server was unable to process request. --> MBException: Opening a connection to the server failed. i can connect to the mediabin and fetch the asset...
0
7894
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7821
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5697
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5370
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3814
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1424
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.