Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My project works fine on my local machine but as soon as I publish it I get the following error.


This is my connectionstring in the web.config file.


"add name="ConfigString" connectionString="Data Source=xxxxxx;Initial Catalog=PreAuth;User Id=Configmod;Password=cvvonf%m0d;" providerName="System.Data.SqlClient" "



Stack Trace:


[ArgumentException: Format of the initialization string does not conform to specification starting at index 0.]
System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +6787193
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +253
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +134
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +103
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +35
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +294
System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key) +60
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +89
System.Data.SqlClient.SqlConnection..ctor(String connectionString, SqlCredential credential) +43
TelesureFinPreAuth.Login.btnSubmit_Click(Object sender, EventArgs e) +862
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804



--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408






I cannot seem to find the problem. Any help would be appreciated.

Kind regards
Divan
Posted
Comments
Sidtrey 14-Jul-15 10:52am    
Is the SQL local or remote? When you publish is it to the same PC or a server etc?
mrDivan 15-Jul-15 2:34am    
Thank you for your reply.
I connect to a sql remote database from my machine and from the remote server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900