473,594 Members | 2,682 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 24230
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 cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at...
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 location is an older one, if that makes any difference. One thing that bothers me is that the SQL...
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 HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
0
4912
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 the correct data. When the page is refreshed I receive the following error message: ...
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. SoapException: Server was unable to process request.---Object reference not set to an instance of an...
1
13034
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 do I do? Why am i getting this error ? How can i remove this
0
1325
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: There was an error generating the XML document. ---> System.InvalidOperationException: Cannot write a...
1
2787
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 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Assignment.rose.dtgFlower_UpdateCommand(Object source,...
0
1604
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 metadata, as i try to revise the metadata i am getting the above specified exception. can anybody help me?
0
7954
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7882
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8377
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8244
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6669
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5415
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3871
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1487
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.