1. I do not have any loaders.
2. Connector is 5.2.1
3. ES 2007.0.0528.0
4. If our evaluation find that MySQL is viable for our business, we plan a full back end switch
5. Yes.
6. The dll is in the bin folder of my project.
As an aside, we have been using ES successfully in our project (with our SQL Server backend) for quite some time without any loader object.
I have added the loaded per the instructions in the "Getting Started" PDF. Now the error is a "FileNotFoundException. Could not load file or assembly 'MySql.Data, Version=5.0.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
My next step was to copy the MySQL.Data from the C:\ProgramFiles\MySQL\MySQL Connector Net 5.2.1\Binaries\.Net 2.0\ folder to the bin folder of my solution.
This changed the error again.
Now the error is a "FileLoadException. Could not load file or assembly 'MySql.Data, Version=5.0.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
Searching on this error brougth me to this thread: http://community.entityspaces.net/forums/thread/1441.aspx which lead me to http://aspadvice.com/blogs/ssmith/archive/2006/11/15/AssemblyBinding-in-Web-Config-and-XMLNS.aspx.
I will continue to update this response as I discover new information.
So I added the runtime tags to my Web.config.
Code:
1 </system.web>
2 <runtime>
3 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
4 <dependentAssembly>
5 <assemblyIdentity name="MySQL.data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
6 <bindingRedirect oldVersion="5.0.0.0-5.0.4.0"
7 newVersion="5.2.1.0"/>
8 </dependentAssembly>
9 </assemblyBinding>
10 </runtime>
11 </configuration>
Code:
1 Protected Sub btnES_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnES.Click
2 InitializeEntitySpaces()
3 Dim it As New BusinessObjects.Item
4 If it.LoadByPrimaryKey(356776) Then
5 Me.GridView2.DataSource = it
6 Me.GridView2.DataBind()
7 End If
8 End Sub
Now instead of failiing on line 4, it fails on line 5. Progress!
And the error has changed again.
I get an InvalidOperationException when I try to assign the BusinessObject as a Datasource to a GridView. "Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource."
Then I realized I was loading up a single record and decided instead to load up a collection.
Code:
1 Protected Sub btnES_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnES.Click
2 InitializeEntitySpaces()
3 Dim its As New BusinessObjects.ItemCollection
4 its.Query.Where(its.Query.Color.Equal("32W"))
5 If its.Query.Load Then
6 Me.TextBox1.Text = its.Count
7 Me.GridView2.DataSource = its
8 Me.GridView2.DataBind()
9 End If
10 End Sub
Badaboom, Badabing! It works.
Hopefully my posting here will be of assistance to someone else in the future.