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="data
source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\AddressBook.mdf;integrated
security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework""
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'