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
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
there is a solution to cast the value retrieve from datareader to a container?
Thank you
yeah the design it's the big problem, but it'snot possible to change ...:( so i need an alternative solution...
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?
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.
In my specific case (million record and container\memo fields)
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
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.
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
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.
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?
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,407
Most Valuable Professional
nmaenpaa
101,156