0
 public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public AddressExamples.AddressBookEntities db = new AddressExamples.AddressBookEntities();
        private void Form1_Load(object sender, EventArgs e)
        {
            
                db.Addresses
                                .OrderBy(entry => entry.LastName)
                                .ThenBy(entry => entry.FirstName)
                                .Load();

                addressBindingSource.DataSource = db.Addresses.Local;
            
            

        }

        private void addressBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            Validate();
            addressBindingSource.EndEdit();
            try
            {
                db.SaveChanges();

            }
            catch(DbEntityValidationException)

            {
                MessageBox.Show("help");
                
            }
        }
    }
}

this is my connection string:

    <add name="AddressBookEntities"
  connectionString="metadata=res://*/AddressModel.csdl|res://*/AddressModel.ssdl|res://*/Ad
dressModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data
source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\AddressBook.mdf;integrated
security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework&quot;"
  providerName="System.Data.EntityClient" />

This is the error : System.Data.Entity.Core.EntityException: 'The underlying provider failed on ConnectionString.' InnerException:ArgumnentException : key word doesnt support :'data source'

  • Please try to paste the error text here. Is your connection string correct? (the error seems to be related to it being incorrect - syntax or user/password) – Alexei - check Codidact Jan 15 '21 at 19:45
  • https://memegenerator.net/img/images/300x300/16804870.jpg Please read [ask] and translate your error message and show that you have researched it. There appears to be a problem with your connection string, show all relevant details, including your connection string. – CodeCaster Jan 15 '21 at 19:45
  • ı added connection string – Seval Mercan Jan 15 '21 at 20:04
  • @Seval Mercan, please refer to the first answer of the question of [https://stackoverflow.com/questions/1404268/keyword-not-supported-data-source](keyword not supported data source) to modify your connection string. – Jack J Jun Jan 18 '21 at 07:16
  • 1
    @Seval Mercan, please refer to the first answer of the question of [not supported data source](https://stackoverflow.com/a/1404442/11507778) to modify your connection string. – Jack J Jun Jan 18 '21 at 07:23

0 Answers0