c# - Connection String null reference exception in other systems -


i need set .dbml connection string because it's change after deploying.
test many posts in google no 1 works me.
here links test in app.
1. setting connection string in dbml files using linq sql in visual studio 2008
2. point connectionstring in dbml app.config
in app code, connection string

<add name="purewater.properties.settings.purewaterconnections"         connectionstring="data source=.;initial catalog=purewater;integrated security=true"         providername="system.data.sqlclient" /> 

according 1 , 2 abbove, set .dbml connection none , left empty. modify .dbml designer code.

after that, call data context (dbml) other windows forms this:

purewatercxtdatacontext cxt = new purewatercxtdatacontext(configurationmanager.connectionstrings["purewater.properties.settings.purewaterconnections"].connectionstring); 

everything ok , don't have error on own system error on other systems on configurationmanager.connectionstrings null reference. odd , can't trace exe file in other system what's happening?

thanks in advance help

update:
app.config file here:

<?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:xdt="http://schemas.microsoft.com/xml-document-transform">     <configsections>     </configsections>     <connectionstrings>       <add name="purewater.properties.settings.purewaterconnections"              connectionstring="data source=.\sqlexpress;initial catalog=purewaterpartovi; integrated security=true;"          providername="system.data.sqlclient" />     </connectionstrings> </configuration> 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -