Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

The ADO.NET provider with invariant name 'System.Data.SqlClient' is either not registered in the machine or application config file, or could not be loaded.

$
0
0

I'm using .Net core 2.0 and after running my app I get this issue:

The ADO.NET provider with invariant name 'System.Data.SqlClient' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.

The specified invariant name 'System.Data.SqlClient' wasn't found in the list of registered .NET Data Providers.

<?xml version="1.0" encoding="utf-8"?><configuration><configSections><!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --><section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /></configSections><connectionStrings><add name="InstayabContext"
         connectionString="Server=.;Database=InstaYab;User Id=blahblah; Password=blahblah;"
         providerName="System.Data.SqlClient" /></connectionStrings><entityFramework><defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"><parameters><parameter value="mssqllocaldb" /></parameters></defaultConnectionFactory><providers><provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /></providers></entityFramework></configuration>
 var _cmd = new Commands();
 _cmd.commentLog(currentUser, fullName, mediaId, pk, userName, description + "/" + text, code);
private readonly myDbContext _db = new myDbContext();

public void commentLog(string CurrentUser,string FullName, string MediaId, long Pk, string Username,string Description,string Code)
        {

            var comment = new Comment
            {
               
                CreatedDate = DateTime.Now,
                CurrentUser = CurrentUser,
                FullName = FullName,
                MediaId = MediaId,
                Pk = Pk,
                Username = Username,
                Description=Description,
                Code=Code
            };
            _db.Comments.Add(comment);
            _db.SaveChanges();

        }


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>