Using consoles apps from SQL to NAV

MTC
Member Posts: 159
I have a slight problem that is totally doing my head in and makes no sense to me, and hopefully one of you might know at least why it is doing this.
I have written a small application in C# that is invoked from SQL Server 2000 using EXEC master..xp_cmdshell in a trigger.
The console application should send an MSMQ to a queue that a NAS is listening to, and that's it. The small C# application works perfectly when run from the command line, and NAS picks up the messages perfectly as well. However, when run from the SQL trigger, it does absolutely nothing apart from the lines of code that output text to the console. It is as if it ignores all code lines that are not writing text to the console. I even commented out the MSMQ functionality and placed some code there that creates a file and writes to that. However, it does exactly the same thing. Works perfectly when run from the comand line, but does nothing if invoked from SQL apart from print to the console, which is the last line in the program. It doesnt even create the output file.
Has this got something to do with permissions? Does anyone have a clue, as it would be much appreciated.
Sorry if this is in the wrong forum.
I have written a small application in C# that is invoked from SQL Server 2000 using EXEC master..xp_cmdshell in a trigger.
The console application should send an MSMQ to a queue that a NAS is listening to, and that's it. The small C# application works perfectly when run from the command line, and NAS picks up the messages perfectly as well. However, when run from the SQL trigger, it does absolutely nothing apart from the lines of code that output text to the console. It is as if it ignores all code lines that are not writing text to the console. I even commented out the MSMQ functionality and placed some code there that creates a file and writes to that. However, it does exactly the same thing. Works perfectly when run from the comand line, but does nothing if invoked from SQL apart from print to the console, which is the last line in the program. It doesnt even create the output file.
Has this got something to do with permissions? Does anyone have a clue, as it would be much appreciated.
Sorry if this is in the wrong forum.
0
Comments
-
I suppose it is run by the SQL Server Agent.
In this case : has your SQL Server Agent-service enough Windows permissions to do it? It can be necessary to change the Windows-user of the SQL Server Agent.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
[Topic moved from Navision forum to SQL General forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
I have wrote the same in Visual Basic .NET and it works no problem. It must be something the C# compiler is doing.0
-
Or it is about permissions for the application. Check the permissions settings of your project. May be that VB.NET is not as strict as C#.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