Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database
Dear Sai sharan, Please find below the valuable details from a SQL expert to solve the error you have mentioned below http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/ Hope it may help. Regards, Venkat --- On Mon, 9/6/10, sai sharan wrote: From: sai sharan Subject: Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database To: Axapta-Knowledge-Village@yahoogroups.com Date: Monday, September 6, 2010, 12:39 PM Hi venkat Raghavan, Thnx fr ur valuable Info. I created a class for connction and i calld that class from SalesFormLetter_pickingList, But it has shown up with an Another Error. can u help me out of this. " A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) " On Mon, Sep 6, 2010 at 9:34 AM, venkat raghavan wrote: Dear Sai Sharan, It worked for you in VPC because, both salesFormLetter and SalesFormLetter_PickingList classes Runon property is by default set to "CalledFrom". In VPC both AOS and Client resides in the same virtual machine, the Runon behaviour will be obviously on server. What you can do is, you can write a class for connecting to the other database and set the Runon property for that class to Server. Then you can call that class from SalesFormLetter_PickingList. Hope it will help you. Regards, Venkat --- On Mon, 9/6/10, venkat raghavan wrote: From: venkat raghavan Subject: Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database To: Axapta-Knowledge-Village@yahoogroups.com Date: Monday, September 6, 2010, 9:17 AM Dear Sai Sharan, Make sure that Runon property is set to server. Regards, Venkat. --- On Sat, 9/4/10, Sai Sharan wrote: From: Sai Sharan Subject: [Axapta-Knowledge-Village] Error in Connecting to Another Database To: Axapta-Knowledge-Village@yahoogroups.com Date: Saturday, September 4, 2010, 6:30 PM Hi all, i had a senario where i need to save some data from Ax_Database to another database. I had Written a code for connecting to the Externa database. It worked fine when i Executed my code in VPC(VirtualPC)., But when i Execute the same code in Client System it showed me a Problem saying that 1.ODBC operation failed.Unable to log on to the database. 2.[Microsoft][SQL Native Client]Login timeout expired. 3.Object 'OdbcConnection' could not be created. i wrote my code in SalesFormLetter Class and i caled from SalesFormLetter_PickingList. waiting fr ur valuable sugessions -- Saisharan koka, PH:9550654880
Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database
Hi Ashish Singh, i had followed what u have to told me , but now getting a new error. I think may be this is an error in Sql Server. I need a way to resolve this error. The error that i got was. '' A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) '' On Sat, Sep 4, 2010 at 11:14 PM, Ashish Singh wrote: > > > Hi Sai Sharan, > > You can see the code in the standard DAX 2009 classes for your reference * > \Classes\SIGSigningProvider_SQLServer_Server* > > Couple of suggestions for you, try to incorporate them. > > a) Try to incroporate the Permission class. > b) Use the CCADO classes rather than ODBC classes for connecting to the > another database. > c) Be careful when supplying the login user name, make sure that the user > name that you are using to connect to other system should not be used more > than once. > d) Put the code inside the Try Catch statement, else you will not be able > to figure out as to why some error had happened at least that is the case > for the CCADO classes. > > This is the sample code that i have posted from you. Here you can see that > i written the code inside the try catch block and see the last part where i > had done the exception handling this will give you detailed error message as > to why error is popping up. This code is consuming the CCADO classes. > > > void openConnection() > { > System.Exception clrException; > InteropPermissionpermission = new > InteropPermission(InteropKind::ClrInterop); > Str localConnectionString; > ; > try > { > permission.assert(); > // BP deviation documented > sqlConnection = new > System.Data.SqlClient.SqlConnection(sqlConnectionString); > if(sqlConnection.get_State() != System.Data.ConnectionState::Open) > { > sqlConnection.Open(); > } > else > { > info("Connection is already open !"); > } > CodeAccessPermission::revertAssert(); > } > catch(Exception::CLRError) > { > // BP deviation documented > clrException = CLRInterop::getLastException(); > if (clrException != null) > { > clrException = clrException.get_InnerException(); > if (clrException != null) > { > //store error - don't throw here > throw error(clrException.get_Message()); > } > } > } > } > Hope this will help you. > > Have a nice day. > > Regards, > ashish singh > *<* > *accenture* > > On Sat, Sep 4, 2010 at 6:30 PM, Sai Sharan wrote: > >> >> >> Hi all, >> i had a senario where i need to save some data from Ax_Database to another >> database. I had Written a code for connecting to the Externa database. >> It worked fine when i Executed my code in VPC(VirtualPC)., But when i >> Execute the same code in Client System it showed me a Problem >> saying that >> 1.ODBC operation failed.Unable to log on to the database. >> 2.[Microsoft][SQL Native Client]Login timeout expired. >> 3.Object 'OdbcConnection' could not be created. >> >> i wrote my code in SalesFormLetter Class and i caled from >> SalesFormLetter_PickingList. >> >> waiting fr ur valuable sugessions >> >> > > -- Saisharan koka, *PH*:9550654880
Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database
Hi venkat Raghavan, Thnx fr ur valuable Info. I created a class for connction and i calld that class from SalesFormLetter_pickingList, But it has shown up with an Another Error. can u help me out of this. " A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) " On Mon, Sep 6, 2010 at 9:34 AM, venkat raghavan wrote: > > > Dear Sai Sharan, > > It worked for you in VPC because, both salesFormLetter > and SalesFormLetter_PickingList classes Runon property is by default set to > "CalledFrom". In VPC both AOS and Client resides in the same virtual > machine, the Runon behaviour will be obviously on server. > > What you can do is, you can write a class for connecting to the other > database and set the Runon property for that class to Server. Then you can > call that class from SalesFormLetter_PickingList. > > Hope it will help you. > > Regards, > Venkat > > --- On *Mon, 9/6/10, venkat raghavan * wrote: > > > From: venkat raghavan > Subject: Re: [Axapta-Knowledge-Village] Error in Connecting to Another > Database > > To: Axapta-Knowledge-Village@yahoogroups.com > Date: Monday, September 6, 2010, 9:17 AM > > > >Dear Sai Sharan, > > Make sure that Runon property is set to server. > > Regards, > Venkat. > > --- On *Sat, 9/4/10, Sai Sharan * wrote: > > > From: Sai Sharan > Subject: [Axapta-Knowledge-Village] Error in Connecting to Another Database > To: Axapta-Knowledge-Village@yahoogroups.com > Date: Saturday, September 4, 2010, 6:30 PM > > > Hi all, > i had a senario where i need to save some data from Ax_Database to another > database. I had Written a code for connecting to the Externa database. > It worked fine when i Executed my code in VPC(VirtualPC)., But when i > Execute the same code in Client System it showed me a Problem > saying that > 1.ODBC operation failed.Unable to log on to the database. > 2.[Microsoft][SQL Native Client]Login timeout expired. > 3.Object 'OdbcConnection' could not be created. > > i wrote my code in SalesFormLetter Class and i caled from > SalesFormLetter_PickingList. > > waiting fr ur valuable sugessions > > > > > -- Saisharan koka, *PH*:9550654880
Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database
Thnx a lo fr ur help. vl get back to u if there are any queries On 9/4/10, Ashish Singh wrote: > > > > > > > Hi Sai Sharan, > > You can see the code in the standard DAX 2009 classes for your reference > \Classes\SIGSigningProvider_SQLServer_Server > > Couple of suggestions for you, try to incorporate them. > > a) Try to incroporate the Permission class. > b) Use the CCADO classes rather than ODBC classes for connecting to the > another database. > c) Be careful when supplying the login user name, make sure that the user > name that you are using to connect to other system should not be used more > than once. > d) Put the code inside the Try Catch statement, else you will not be able to > figure out as to why some error had happened at least that is the case for > the CCADO classes. > > This is the sample code that i have posted from you. Here you can see that i > written the code inside the try catch block and see the last part where i > had done the exception handling this will give you detailed error message as > to why error is popping up. This code is consuming the CCADO classes. > > > void openConnection() > { > System.Exception clrException; > InteropPermissionpermission = new > InteropPermission(InteropKind::ClrInterop); > Str > localConnectionString; > ; > try > { > permission.assert(); > // BP deviation documented > sqlConnection = new > System.Data.SqlClient.SqlConnection(sqlConnectionString); > if(sqlConnection.get_State() != > System.Data.ConnectionState::Open) > { > sqlConnection.Open(); > } > else > { > info("Connection is already open !"); > } > CodeAccessPermission::revertAssert(); > } > catch(Exception::CLRError) > { > // BP deviation documented > clrException = CLRInterop::getLastException(); > if (clrException != null) > { > clrException = > clrException.get_InnerException(); > if (clrException != null) > { > //store error - don't throw here > throw error(clrException.get_Message()); > } > } > } > } > > Hope this will help you. > > Have a nice day. > > Regards, > ashish singh > < > accenture > > > On Sat, Sep 4, 2010 at 6:30 PM, Sai Sharan wrote: > > > > > > > > > > > > > > > Hi all, > > i had a senario where i need to save some data from Ax_Database to another > database. I had Written a code for connecting to the Externa database. > > It worked fine when i Executed my code in VPC(VirtualPC)., But when i > Execute the same code in Client System it showed me a Problem > > saying that > > 1.ODBC operation failed.Unable to log on to the database. > > 2.[Microsoft][SQL Native Client]Login timeout expired. > > 3.Object 'OdbcConnection' could not be created. > > > > i wrote my code in SalesFormLetter Class and i caled from > SalesFormLetter_PickingList. > > > > waiting fr ur valuable sugessions > > > > > > > > > > > -- thnx for ur valuable sugessions.i vl check d code and come back to u if dere are any queries. Saisharan koka, *PH*:9550654880 News-Flash of Axapta Knowledge Village === VISIT THE Microsoft Dynamics AX Knowledge Village at LINKEDIN: http://www.linkedin.com/e/gis/165338. Sharing the knowledge on Axapta. Visit www.frappr.com/axapta for axapta friends. Come and choose your preferred name for Microsoft Dynamics AX on the Axapta Knowledge Village, Visit www.axapta-knowledge-village.tk Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Axapta-Knowledge-Village/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/Axapta-Knowledge-Village/join (Yahoo! ID required) <*> To change settings via email: axapta-knowledge-village-dig...@yahoogroups.com axapta-knowledge-village-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: axapta-knowledge-village-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database
Dear Sai Sharan, It worked for you in VPC because, both salesFormLetter and SalesFormLetter_PickingList classes Runon property is by default set to "CalledFrom". In VPC both AOS and Client resides in the same virtual machine, the Runon behaviour will be obviously on server. What you can do is, you can write a class for connecting to the other database and set the Runon property for that class to Server. Then you can call that class from SalesFormLetter_PickingList. Hope it will help you. Regards, Venkat --- On Mon, 9/6/10, venkat raghavan wrote: From: venkat raghavan Subject: Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database To: Axapta-Knowledge-Village@yahoogroups.com Date: Monday, September 6, 2010, 9:17 AM Dear Sai Sharan, Make sure that Runon property is set to server. Regards, Venkat. --- On Sat, 9/4/10, Sai Sharan wrote: From: Sai Sharan Subject: [Axapta-Knowledge-Village] Error in Connecting to Another Database To: Axapta-Knowledge-Village@yahoogroups.com Date: Saturday, September 4, 2010, 6:30 PM Hi all, i had a senario where i need to save some data from Ax_Database to another database. I had Written a code for connecting to the Externa database. It worked fine when i Executed my code in VPC(VirtualPC)., But when i Execute the same code in Client System it showed me a Problem saying that 1.ODBC operation failed.Unable to log on to the database. 2.[Microsoft][SQL Native Client]Login timeout expired. 3.Object 'OdbcConnection' could not be created. i wrote my code in SalesFormLetter Class and i caled from SalesFormLetter_PickingList. waiting fr ur valuable sugessions
Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database
Dear Sai Sharan, Make sure that Runon property is set to server. Regards, Venkat. --- On Sat, 9/4/10, Sai Sharan wrote: From: Sai Sharan Subject: [Axapta-Knowledge-Village] Error in Connecting to Another Database To: Axapta-Knowledge-Village@yahoogroups.com Date: Saturday, September 4, 2010, 6:30 PM Hi all, i had a senario where i need to save some data from Ax_Database to another database. I had Written a code for connecting to the Externa database. It worked fine when i Executed my code in VPC(VirtualPC)., But when i Execute the same code in Client System it showed me a Problem saying that 1.ODBC operation failed.Unable to log on to the database. 2.[Microsoft][SQL Native Client]Login timeout expired. 3.Object 'OdbcConnection' could not be created. i wrote my code in SalesFormLetter Class and i caled from SalesFormLetter_PickingList. waiting fr ur valuable sugessions
RE: [Axapta-Knowledge-Village] Error in Connecting to Another Database
A quick note: i wrote my code in SalesFormLetter Class and i caled from SalesFormLetter_PickingList. The below try catch block will need to be at a place where ttslevel = 0 Regards harry From: Axapta-Knowledge-Village@yahoogroups.com [mailto:axapta-knowledge-vill...@yahoogroups.com] On Behalf Of Ashish Singh Sent: Saturday, September 04, 2010 10:44 AM To: Axapta-Knowledge-Village@yahoogroups.com Subject: Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database Hi Sai Sharan, You can see the code in the standard DAX 2009 classes for your reference \Classes\SIGSigningProvider_SQLServer_Server Couple of suggestions for you, try to incorporate them. a) Try to incroporate the Permission class. b) Use the CCADO classes rather than ODBC classes for connecting to the another database. c) Be careful when supplying the login user name, make sure that the user name that you are using to connect to other system should not be used more than once. d) Put the code inside the Try Catch statement, else you will not be able to figure out as to why some error had happened at least that is the case for the CCADO classes. This is the sample code that i have posted from you. Here you can see that i written the code inside the try catch block and see the last part where i had done the exception handling this will give you detailed error message as to why error is popping up. This code is consuming the CCADO classes. void openConnection() { System.Exception clrException; InteropPermissionpermission = new InteropPermission(InteropKind::ClrInterop); Str localConnectionString; ; try { permission.assert(); // BP deviation documented sqlConnection = new System.Data.SqlClient.SqlConnection(sqlConnectionString); if(sqlConnection.get_State() != System.Data.ConnectionState::Open) { sqlConnection.Open(); } else { info("Connection is already open !"); } CodeAccessPermission::revertAssert(); } catch(Exception::CLRError) { // BP deviation documented clrException = CLRInterop::getLastException(); if (clrException != null) { clrException = clrException.get_InnerException(); if (clrException != null) { //store error - don't throw here throw error(clrException.get_Message()); } } } } Hope this will help you. Have a nice day. Regards, ashish singh < accenture On Sat, Sep 4, 2010 at 6:30 PM, Sai Sharan mailto:saisharan@gmail.com>> wrote: Hi all, i had a senario where i need to save some data from Ax_Database to another database. I had Written a code for connecting to the Externa database. It worked fine when i Executed my code in VPC(VirtualPC)., But when i Execute the same code in Client System it showed me a Problem saying that 1.ODBC operation failed.Unable to log on to the database. 2.[Microsoft][SQL Native Client]Login timeout expired. 3.Object 'OdbcConnection' could not be created. i wrote my code in SalesFormLetter Class and i caled from SalesFormLetter_PickingList. waiting fr ur valuable sugessions
Re: [Axapta-Knowledge-Village] Error in Connecting to Another Database
Hi Sai Sharan, You can see the code in the standard DAX 2009 classes for your reference * \Classes\SIGSigningProvider_SQLServer_Server* Couple of suggestions for you, try to incorporate them. a) Try to incroporate the Permission class. b) Use the CCADO classes rather than ODBC classes for connecting to the another database. c) Be careful when supplying the login user name, make sure that the user name that you are using to connect to other system should not be used more than once. d) Put the code inside the Try Catch statement, else you will not be able to figure out as to why some error had happened at least that is the case for the CCADO classes. This is the sample code that i have posted from you. Here you can see that i written the code inside the try catch block and see the last part where i had done the exception handling this will give you detailed error message as to why error is popping up. This code is consuming the CCADO classes. void openConnection() { System.Exception clrException; InteropPermissionpermission = new InteropPermission(InteropKind::ClrInterop); Str localConnectionString; ; try { permission.assert(); // BP deviation documented sqlConnection = new System.Data.SqlClient.SqlConnection(sqlConnectionString); if(sqlConnection.get_State() != System.Data.ConnectionState::Open) { sqlConnection.Open(); } else { info("Connection is already open !"); } CodeAccessPermission::revertAssert(); } catch(Exception::CLRError) { // BP deviation documented clrException = CLRInterop::getLastException(); if (clrException != null) { clrException = clrException.get_InnerException(); if (clrException != null) { //store error - don't throw here throw error(clrException.get_Message()); } } } } Hope this will help you. Have a nice day. Regards, ashish singh *<* *accenture* On Sat, Sep 4, 2010 at 6:30 PM, Sai Sharan wrote: > > > Hi all, > i had a senario where i need to save some data from Ax_Database to another > database. I had Written a code for connecting to the Externa database. > It worked fine when i Executed my code in VPC(VirtualPC)., But when i > Execute the same code in Client System it showed me a Problem > saying that > 1.ODBC operation failed.Unable to log on to the database. > 2.[Microsoft][SQL Native Client]Login timeout expired. > 3.Object 'OdbcConnection' could not be created. > > i wrote my code in SalesFormLetter Class and i caled from > SalesFormLetter_PickingList. > > waiting fr ur valuable sugessions > > >