Monday, March 26, 2012

How can I change a local connectionstring??

Hi,
this is my connectionstring:
mySqlConnection.ConnectionString = "Data
Source=.\SQLEXPRESS;AttachDbFilename='C:\Documents and Settings\me\Mis
documentos\Visual Studio
2005\Projects\Conferencia\Conferencia\dbConferenci a.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\Conferencia\Conferencia\dbConferenci a.mdf' for
something like .\dbConferencia.mdf?
I've tried a few different ways, but i didn't get it
Thanks
david
Try putting the mdf in a App_Dat folder in your project/site
and change the connection string from C:Documnet ...
to App_Data\dbConferencia.mdf'
Paul Zanbaka
www.mycodekb.com
"dsoto@.plus-supermercados.es" wrote:

> Hi,
> this is my connectionstring:
> mySqlConnection.ConnectionString = "Data
> Source=.\SQLEXPRESS;AttachDbFilename='C:\Documents and Settings\me\Mis
> documentos\Visual Studio
> 2005\Projects\Conferencia\Conferencia\dbConferenci a.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\Conferencia\Conferencia\dbConferenci a.mdf' for
> something like .\dbConferencia.mdf?
> I've tried a few different ways, but i didn't get it
> Thanks
> david
>

No comments:

Post a Comment