Read optionstring directly from SQL Server table

awinav
Member Posts: 8
Hi,
I'm working on an external .NET application to show some data from Navision tables by accessing the SQL Server. If the table has an OptionString field, I would get an integer instead of the string representation.
Does anyone know where this string information is stored in SQL Server?
Currently I'm using enum to map the optionstring in my .NET application, but everytime I change the OptionString in Navision, I have to update the application also.
I know I could have used Code field combined with FlowField for this purpose, but wasting a table just for storing 3 options is too expensive for me.
Any thoughts and help will be very appreciated.
I'm working on an external .NET application to show some data from Navision tables by accessing the SQL Server. If the table has an OptionString field, I would get an integer instead of the string representation.
Does anyone know where this string information is stored in SQL Server?
Currently I'm using enum to map the optionstring in my .NET application, but everytime I change the OptionString in Navision, I have to update the application also.
I know I could have used Code field combined with FlowField for this purpose, but wasting a table just for storing 3 options is too expensive for me.
Any thoughts and help will be very appreciated.
0
Comments
-
Hi,
To my knowledge the optionstring values isn't stored in any SQL Server table. You will have to hardcode it in you application or store the values in a setup table.
Regards
Claus0 -
But if I did an SQL Server backup and restored it in another server, Navision and all it's OptionStrings were all there. So it must be stored somewhere in the tables.0
-
That's true. The option strings are stored in the Navision objects definition which is stored in the object table as a blob field and I don't think it will be easy to extract the information from there.
Regards
Claus0 -
ClausHamann wrote:That's true. The option strings are stored in the Navision objects definition which is stored in the object table as a blob field and I don't think it will be easy to extract the information from there.
Regards
ClausRegards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
If you analyse how the objects are stored in the database you will see that some of the contents are readable.
Eg. I created a field called MyField with the options: Option,second,third
this is how it is represented (in hex):4D 79 46 69 65 6C 64 00 64 28 28 00 01 00 09 00 4F 70 74 69 6F 6E 00 00 02 00 09 00 73 65 63 6F 6E 64 00 00 03 00 0A 00 74 68 69 72 64 00 00 00 00
This is: MyField 00 d ( ( 00 01 00 09 00 Option 00 00 02 00 09 00 second 00 00 03 00 0a 00 third 00 00 00 00 00
So you can see that it is: FieldName null d ( something null 01 something something something Value1 null null 02 something something something Value2 null null 03 Value3 a whole bunch nulls
So you can see that there is a definite pattern and thus the details can be extracted.
So it's not impossible, it's just not easy. 8)This isn't a signature, I type this at the bottom of every message0 -
[Topic moved from Navision Attain forum to Navision Tips & Tricks forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Moved a post to another topic : (http://www.mibuso.com/forum/viewtopic.php?t=27846)Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions