I added Entity Framework to my project but I call the toList()
method and I'm getting an error:
okuldbEntities ent = new okuldbEntities();
private void Form1_Load(object sender, EventArgs e)
{
dataGridView1.DataSource = ent.ogrenciler.ToList();
}
and this is the error:
This exception was originally thrown at this call stack: [External Code]
Inner Exception 1: MySqlException: Table 'okuldb.okuldb.ogrenciler' doesn't exist
okuldb
is my database name and I didn't find why it added it twice.
I looked a lot. I installed VMWare did it all again, but got the same result.
my steps:
i add datagridview1 and i write this code:
eokulEntities ent = new eokulEntities();
private void Form1_Load(object sender, EventArgs e)
{
dataGridView1.DataSource = ent.ogrencinot.ToList();
}
and i runnig and i see this message:
This exception was originally thrown at this call stack: [External Code]
Inner Exception 1: MySqlException: Table 'eokul.eokul.ogrencinot' doesn't exist
i try too much way. i found another laptop i format it and i install again all this.
and again same error.
really what can i do?
1.Close your visual studio project
2.Edit Model1.edmx file with notepad /or what is the name in your project/
3.Replace matches in file, from Schema="okuldb" to Schema=""
4.Save Model1.edmx file
5.Open visual studio project
6.Compile Project
7.Run Application