0

I have found plenty of information on this subject on stack overflow as well as on the web but none of it seems to help.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
namespace GeoCode.Models
{
 public class address
 {
 [Key]
 public int ARENA_ID { get; set; }
 public string ADDRESS1 { get; set; }
 public string CITY { get; set; }
 public string ZIP { get; set; }
 public decimal COUNTRY { get; set; }
 }
 public class latlng
 {
 [Key]
 public int ARENA_ID { get; set; }
 public string LAT { get; set; }
 public string LNG { get; set; }
 }
 public class GeoCodeDBContext : DbContext
 {
 public DbSet<address> WEB_ARENA { get; set; }
 public DbSet<latlng> WEB_ARENA_GEO { get; set; }
 }
}

And when I use this model to create a class with read/write actions and views using entity framework I get the error, "unable to find requested .net framework data provider. It may not be installed."

My connection string is:

 <add name="GeoCodeDBContext"
 connectionString="server=********;database=*****;uid=*****;pwd=******"
 providerName="System.Data.SqlServer"/>
Patrick Hofman
157k23 gold badges269 silver badges343 bronze badges
asked Oct 15, 2014 at 13:23
1
  • 2
    Should be providerName="System.Data.SqlClient" Commented Oct 15, 2014 at 13:26

2 Answers 2

2

The provider providerName="System.Data.SqlServer" does not exist. It should be providerName="System.Data.SqlClient".

See the documentation on ProviderName. It might be nice to know that System.Data.SqlClient is actually the default value, so you don't even need to provide a value for providerName.

answered Oct 15, 2014 at 13:27
1

You have specified the wrong provider in your connection string. System.Data.SqlServer is not a provider. Try this instead:

<add name="GeoCodeDBContext"
 connectionString="..."
 providerName="System.Data.SqlClient"/>
answered Oct 15, 2014 at 13:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.