Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

The 4.5 .net provider works up to .net 4.8 without any problems.

I just put together an application using .net 8 - the 4.5 .net provider still manages most calls to the DB except when it comes to byte - for instance...

Public Function InsertEmailAttachment(Attachment() As Byte, Inbox_ID As Integer, FileName As String) As Boolean
Try
    Dim strSQL As String = ""
    Using Conn As New SAConnection
        Conn.ConnectionString = HASConString
        Dim vCmd As SACommand = Conn.CreateCommand
        vCmd.Parameters.AddWithValue("@Mail_Inbox_ID", Inbox_ID)
        vCmd.Parameters.AddWithValue("@Attachment_FileName", FileName)
        vCmd.Parameters.AddWithValue("@Attachment", Attachment)
        strSQL = "INSERT INTO Mail_Inbox_Attachments (Mail_Inbox_ID, Attachment_FileName, Attachment) VALUES (?, ?, ?)"
        vCmd.CommandText = strSQL
        Conn.Open()
        vCmd.ExecuteNonQuery()
        Conn.Close()
    End Using
    Return True
Catch ex As Exception
    EmailError(ex)
    Return False
End Try
End Function

That throws - Could not load file or assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.

If I refence that dll in the project I get - System.BadImageFormatException: Cannot load a reference assembly for execution.

Is there a later version of the Sybase provider that is not reliant on System.Data.Entity, or some other workaround other than OLE.DB?

asked 27 Feb, 01:26

gchq's gravatar image

gchq
421263241
accept rate: 27%

edited 27 Feb, 01:27


Problem solved - I referenced a 32 bit version of System.Data.Entity and there was a 'bitness' mismatch - it now works :-)

permanent link

answered 27 Feb, 04:08

gchq's gravatar image

gchq
421263241
accept rate: 27%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×246
×76
×7

question asked: 27 Feb, 01:26

question was seen: 195 times

last updated: 27 Feb, 04:08