Error:Inconvertible type mismatch between Byte[] and String

Error:Inconvertible type mismatch between Byte[] and String

Postby deynard » Thu 11 Aug 2011 15:51

The query below works using Devart.Data.dll 5.0.40.0 and Devart.Data.MySql.dll 5.50.79.0 and returning it to a typed data table, but I get the error message "Error Message:Inconvertible type mismatch between SourceColumn 'ID' of Byte[] and the DataColumn 'ID' of String."
when using Devart.Data.MySql.dll 6.30.172.0(Devart.Data.dll 5.0.272.0) or 6.30.196.0(Devart.Data.dll 5.0.295.0)

SELECT DISTINCT mt.LCCN ID, mt.Title, SortTitle, 'LC' Source
FROM lcmarc.marctitle mt
INNER JOIN lcmarc.marcisbn mi ON (mt.LCCN = mi.LCCN)
WHERE (ISBN LIKE '9780700617197%')
UNION
SELECT STRAIGHT_JOIN DISTINCT bk.BookID ID, bk.Title, bk.TitleSort SortTitle, 'MLS' Source
FROM interacq.books bk
WHERE ((ClothISBN = '9780700617197') OR (PaperISBN = '9780700617197'))
ORDER BY SortTitle, Title
LIMIT 0, 100
MySQL Database is 5.1.42-community

How do I fix this error? or is it Devart error?
I get the error on the "da.Fill(dt)" line below

Dim dt As New searchresultsDataTable
Dim cmd As New MySqlCommand
Dim da As New MySqlDataAdapter
cmd.Connection = Adapter.Connection
cmd.CommandTimeout = 240
Dim sql As New StringBuilder
sql.AppendLine("SELECT DISTINCT mt.LCCN ID, mt.Title, SortTitle, 'LC' Source")
sql.AppendLine("FROM lcmarc.marctitle mt")
sql.AppendLine(" INNER JOIN lcmarc.marcisbn mi ON (mt.LCCN = mi.LCCN) ")
sql.AppendLine("WHERE (ISBN LIKE '9780700617197%') ")
sql.AppendLine("UNION")
sql.AppendLine("SELECT STRAIGHT_JOIN DISTINCT bk.BookID ID, bk.Title, bk.TitleSort SortTitle, 'MLS' Source")
sql.AppendLine("FROM interacq.books bk")
sql.AppendLine("WHERE ((ClothISBN = '9780700617197') OR (PaperISBN = '9780700617197'))")
sql.AppendLine(" ORDER BY SortTitle, Title")
sql.AppendLine("LIMIT 0, 100")
cmd.CommandText = sql.ToString
LogFileAPI.Save("Collection Searching", My.User.Name, 0, sql.ToString)
da.SelectCommand = cmd
da.Fill(dt)
da.Dispose()
cmd.Dispose()
I can supply table definitions
deynard
 
Posts: 1
Joined: Fri 25 Jul 2008 16:48
Location: Missouri, USA

Postby Shalex » Mon 15 Aug 2011 12:08

We have answered you by e-mail.
Shalex
Devart Team
 
Posts: 7344
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL