Home > Archive > MS SQL Server > March 2006 > How can I change a local connectionstring????









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How can I change a local connectionstring????
dsoto@plus-supermercados.es

2006-03-05, 8:24 pm

Hi,

this is my connectionstring:

mySqlConnection.ConnectionString = "Data
Source=. \SQLEXPRESS;AttachDb
Filename='C:\Documen
ts and Settings\me\Mis
documentos\Visual Studio
2005\Projects\Confer
encia\Conferencia\db
Conferencia.mdf';Integrated
Security=True;User Instance=True;"

and the problems comes when I publish the project, because it is not
possible to access to the database which path is in my local computer.

how can I change 'C:\Documents and Settings\me\Mis documentos\Visual
Studio 2005\Projects\Confer
encia\Conferencia\db
Conferencia.mdf' for
something like .\dbConferencia.mdf?

I've tried a few different ways, but i didn't get it :(

Thanks

david

Paul Zanbaka

2006-03-05, 8:24 pm

Try putting the mdf in a App_Dat folder in your project/site
and change the connection string from C:Documnet ....
to App_Data\dbConferenc
ia.mdf'
--
Paul Zanbaka
www.mycodekb.com


"dsoto@plus-supermercados.es" wrote:

> Hi,
>
> this is my connectionstring:
>
> mySqlConnection.ConnectionString = "Data
> Source=. \SQLEXPRESS;AttachDb
Filename='C:\Documen
ts and Settings\me\Mis
> documentos\Visual Studio
> 2005\Projects\Confer
encia\Conferencia\db
Conferencia.mdf';Integrated
> Security=True;User Instance=True;"
>
> and the problems comes when I publish the project, because it is not
> possible to access to the database which path is in my local computer.
>
> how can I change 'C:\Documents and Settings\me\Mis documentos\Visual
> Studio 2005\Projects\Confer
encia\Conferencia\db
Conferencia.mdf' for
> something like .\dbConferencia.mdf?
>
> I've tried a few different ways, but i didn't get it :(
>
> Thanks
>
> david
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com