web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Binary data to container conversion

(0) ShareShare
ReportReport
Posted on by

Hi, i need to  read binary data from sql server( a container column from a table) and assign to a container variable, how it's possible to do that?

Thank you

Eddy

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Binary data to container conversion

    there is a solution to cast the value retrieve from datareader to a container?

    Thank you

  • Community Member Profile Picture
    on at
    RE: Binary data to container conversion

    yeah the design it's the big problem, but it'snot possible to change ...:( so i need an alternative solution...

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Binary data to container conversion

    By the way, what kind of binary data do you store there and why do you fetch million records with such fields? Isn't the core problem in database schema design?

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Binary data to container conversion

    Can you please show the two queries and compare their execution plans? That will reveal where these two things differ and (hopefully) you should be able to update what you do in AX to achieve the same performance.

  • Community Member Profile Picture
    on at
    RE: Binary data to container conversion

    In my specific case (million record and container\memo fields)

  • Community Member Profile Picture
    on at
    RE: Binary data to container conversion

    Hi Martin ,

    i don't think it's same thing, run the while select from Ax it's much more  "expensive" than run  a query and  after using a while with  Datareader (in memory).

    Thank you

    Eddy

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Binary data to container conversion

    Oh, that's a wrong approach. If you run the same query, you'll get the same performance, and you'll waste time to develop code that isn't needed and will be difficult to maintain.

    I suggest you stop coding and and rather look at the performance problem. Tell us more about it if you need help.

  • Community Member Profile Picture
    on at
    RE: Binary data to container conversion

    Yes the field is a container type  and is on sql database is varbinary (AX db)

    I must use directly db connection with datareader because while select it's too slow...but i'm not able to cast container variable from sqldatareader.get()....

    It's possible to do that with other API?

    Thank you

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Binary data to container conversion

    Then the data type isn't container, because SQL server doesn't have such a type, right? Or do you mean by that that the SQL field is actually a part of AX database? If so, why do you use a direct query?

    Am I right in assuming that datareader is an instance of .NET class SqlDataReader? (It will help if you give us more information and don't let us guessing.)

    By the way, I avoid SqlDataReader; there are much better APIs that can generate strongly-typed data model from the database schema and make your development much easier and safer.

  • Community Member Profile Picture
    on at
    RE: Binary data to container conversion

    I read binary data via ado connection and i want assign to a container value

    Es.

    Container con = datareader.GET....

    it'spossible to do that?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans