Get sql server/database name through code
wilk_u
Member Posts: 94
Hi, is there any way to get nav sql server name through c/al code to use it in connection string?
0
Comments
-
Use Server table0
-
Server? How is it named? Can't find it0
-
Its table 2000000047..
Use form wizard to see..0 -
You can also use CONTEXTURL function.0
-
May sound weird but i don't have such table. Just Company and windows login around table no. You specified.
Appreciate Your help satbir but looks like ms made it obsolete and nav returns error when using it
0 -
-
Thank You for Your answer, got it
0 -
hi all
i create codeunit to get server name
when i test it using message, it can show my server name
but when using webservice, there is an error messageMetadata for object of type Table with id 2000000047 is in a failed state. This is caused by a previous exception:
Table 2000000047 is not available and cannot be opened.
anybody know how to solve?
thanks0 -
hi,
Table 2000000047 is a hidden table named as "Server" in Navision Database.
For the error -Metadata for object of type Table with id 2000000047 is in a failed state. This is caused by a previous exception:
Table 2000000047 is not available and cannot be opened.
Please check by creating a form with table id 2000000047, if it didnt work then i think you are using an old version database( < 6SP1).
Thanks & Regards,
Saurav Dhyani
http://saurav-nav.blogspot.in/
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
i already solved it
using this codeIF ISSERVICETIER THEN BEGIN IF ISCLEAR(DomDoc) THEN CREATE(DomDoc); DomDoc.load(APPLICATIONPATH + 'CustomSettings.config'); DomNode := DomDoc.selectSingleNode( '//appSettings/add[@key=''DatabaseServer'']'); MyServerName := DomNode.attributes.item(1).text; end;0 -
For us XML newbies, what are the Automation variable subtypes for DomDoc and DomNode?Ron0
-
rsaritzky wrote:For us XML newbies, what are the Automation variable subtypes for DomDoc and DomNode?Name DataType Subtype Length
DomDoc Automation ‘Microsoft XML, v6.0′.DOMDocument
DomNode Automation ‘Microsoft XML, v6.0′.IXMLDOMNode0 -
mohana_cse06 wrote:rsaritzky wrote:For us XML newbies, what are the Automation variable subtypes for DomDoc and DomNode?Name DataType Subtype Length
DomDoc Automation ‘Microsoft XML, v6.0′.DOMDocument
DomNode Automation ‘Microsoft XML, v6.0′.IXMLDOMNode
Thanks, Mohana!
RonRon0 -
Thanks all for Your help
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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

