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

InfoPath alternatives for form designing SharePoint

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

I have put my connection string in web.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 stored procedure

– How to populate 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

Solution:

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;”/>

Similar SharePoint 2013 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 SharePointSky.com

View all posts by Bijay Kumar →

Leave a Reply