I have 3 connectionstrings in web.config and I used them like this:
using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SomeName"].ConnectionString))
Each metgod is called by the winforms application.
One of the web methods does not work properly, because it reads only one String connection:
data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
This is not the connectionString from my web.config.
I call each method in the same way.
How is this impossible?
Edition:
I use the facade: This is the structure: WinForms calls WebMethod SaveItem Method to call SaveItem on the Facade: SaveItemAndDoDatabaseStuff SaveItemAndDoDatabaseStuff makes the database.
source
share