Keyword not supported data source error in Asp.Net Enterprise Library

Check out Best Alternative to InfoPath

In this post, we will discuss how to resolve the issue of Keyword not supported: ‘data source’. which comes while working in the Enterprise library.

I have put my connection string in web. a config like below:

<add name=”MyConnection” providerName=”System.Data.SqlClient” connectionString=”Data  Source=WIN-PFCP2DGT8DI;database=LetUsDiscuss;Integrated Security=SSPI;”/>

You may like to read:

– Data access block of Microsoft enterprise library 6.0 using a stored procedure

– How to populate the dataset with data adapter and XML in Asp.Net?

– Difference between Sequence and Identity in Sql Server

But I was getting the below error:

Keyword not supported: ‘data source’.

   at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)

   at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)

   at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)

   at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)

   at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)

   at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)

   at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)

   at Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateConnection()

   at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetNewOpenConnection()

   at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetWrappedConnection()

   at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection()

   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command)

   at UserMaster.SignUp(String fullname, String emailid, String password) in e:\Bijaya\\App_Code\UserMaster.cs:line 32


It was a silly mistake from my side. There was two spaces between the keyword Data and Source. When I remove one space, then it worked. Like below:

<add name=”MyConnection” providerName=”System.Data.SqlClient” connectionString=”Data Source=WIN-PFCP2DGT8DI;database=LetUsDiscuss;Integrated Security=SSPI;”/>

Hope this will be helpful.

You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site

View all posts by Bijay Kumar →