MySqlDataSourceItem...?


Author
Message
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Well the day has come BigGrin

I have a small project and have to be done with MySQL no other way around.  Based on Trent suggestions I created a MySQLDataSourceItem.vb class using the SQLDataSourceItem.vb class in SF source code.

I basically replaced all MS-SQL commands with their counterpart for MySQL but of course I started to hit some blocks, for now the GetDataTable() method is not working, it uses a SqlDependency() object which I have not been able to find a substitute for MySql

''' <summary>

''' Executes the given command on the data source and returns the results.

''' </summary>

''' <param name="Command"></param>

''' <param name="CallBack"></param>

''' <returns></returns>

''' <remarks></remarks>

Public Overloads Overrides Function GetDataTable(ByVal Command As System.Data.Common.DbCommand, ByVal CallBack As OnChangeEventHandler) As System.Data.DataTable

'-- Establish locals

Dim loDep As SqlDependency

'-- Add the handler to the dependency

If CallBack IsNot Nothing Then

loDep = New SqlDependency()

AddHandler loDep.OnChange, CallBack

loDep.AddCommandDependency(CType(Command, SqlCommand))

Try

'SqlDependency.Start(Command.Connection.ConnectionString)

SqlDependency.Start(CreateBlankDbConnection().ConnectionString)

Catch ex As Exception

MsgBox(ex.Message)

End Try

End If

'-- Execute the command

Return MyBase.GetDataTable(Command, CallBack)

End Function

I would appreciate if somebody could take a look at this class (attached) and help out getting this to work. 

I am using the MySQL .Net Connector which it is working just fine from the Server Explorer in VS2010, I am able to connect to the database and see the tables.  In order to use the BOM I had to create a dummy DDT project to map the BO from the BOM.  At this point I am just trying to read the MySQL table, but I also will need to update it as well.

Trent, Dustin, Steve, please we really, really, really need more commitment to the SF community and the framework. Pinch

Edhy Rijo

Attachments
MySqlDataSourceItem.zip (135 views, 7.00 KB)
Replies
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Bill, Keith,

Thanks a lot for the rescue, commenting the code allow me to move forward and at least now I can fill the BO.  Now to see if I can insert/modify records.

Keith, thanks for sharing your class, will take a look, but I need to be able to modify and insert records, normal operation basically.

This could be very frustrating process specially when the database has a .Net driver wich works from plain .net BigGrin

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Edhy, one thought I had was to look at the OracleDataSourceItem and see what it did. It can't be using the a SqlDependency object right? Well, it turns out that GetDataTable is implemented in DbDataSourceItem and you don't even need to deal with it. The OracleDataSourceItem does not include this function at all.



I.e. you can delete it...let's translate that into Texan...you can smoke it! BigGrin
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Greg McGuffey (04/29/2010)
I.e. you can delete it...let's translate that into Texan...you can smoke it! BigGrin

Thanks Greg, yes that is what I did.  Now I am fighting "DateTime/Date" translations.  BigGrin

Like I said it would be a painful process.  Have anybody seen Trent? Crying

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search