how to set the connection string to App_Data folder database for hosting

Posted by mohammedr88-18313 under ASP.NET on 4/26/2014 | Points: 10 | Views : 1792 | Status : [Member] | Replies : 5
Hi all

kinldy help me out on this, how to set the connection string to App_Data folder database for hosting



Regards
Mohammed rafi




Responses

Posted by: Prabu_Spark on: 4/29/2014 [Member] Starter | Points: 25

Up
0
Down
Hi Mohammed Rafi,
Kindly used the below connection string to access the database inside the AppData folder.


<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>


With regards,
J.Prabu.
[Email:prbspark@gmail.com]

mohammedr88-18313, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: mohammedr88-18313 on: 5/3/2014 [Member] Starter | Points: 25

Up
0
Down
hi Prabu,

thank u , but im asking while hosting

mohammedr88-18313, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: mohammedr88-18313 on: 5/3/2014 [Member] Starter | Points: 25

Up
0
Down
while hosting to ftp site

mohammedr88-18313, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabu_Spark on: 5/3/2014 [Member] Starter | Points: 25

Up
0
Down
Hi Mohammed Rafi,
I cant able to understand your questions, In web.config file, we can set the connection string to access the database. Kindly ask clearly to get help from others. What code your using currently in your application.

With regards,
J.Prabu.
[Email:prbspark@gmail.com]

mohammedr88-18313, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: mohammedr88-18313 on: 5/5/2014 [Member] Starter | Points: 25

Up
0
Down
Hi
1) Im using a database which is in App_Data folder for this the connection string is ,

<connectionStrings>

<add name="MyConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=.\SQLEXPRESS;database=C:\WebApplication2\WebApplication2\App_Data\LocalDatabase.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

</connectionStrings>


2) on hosting tat application to ftp server the App_Data folder location changes for this how to specify the connection string ?





mohammedr88-18313, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response