Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

pls review my code for gp connection

Posted on by 660

Hi, Friends

                   I had write the following code to retrieve data from gp sql server..But an error "login failed for user is shown"..why this happen? pls help me

 //code

  
           string    connectionString = "Data Source=servername;Initial Catalog=dbname;Integrated Security=SSPI;Persist Security Info = false;Packet Size = 4096";
             eConnectMethods eConnectObject = new eConnectMethods();
            eConnectOut myRequest = new eConnectOut();
                    
            myRequest.DOCTYPE = "Customers";
           myRequest.OUTPUTTYPE = 1;
           myRequest.INDEX1FROM = "AARONFIT0001";
          myRequest.INDEX1TO = "AARONFIT0001";
            myRequest.FORLIST = 1;

                 RQeConnectOutType eConnectOutType =  new RQeConnectOutType();

            eConnectOutType[0].eConnectOut = myRequest; // error appears in this line
            eConnectType eConnectDoc = new eConnectType();
            eConnectDoc.RQeConnectOutType = new RQeConnectOutType[1] {eConnectOutType};

            MemoryStream memStream = new MemoryStream();
            XmlSerializer serializer = new XmlSerializer(typeof(eConnectType));
            serializer.Serialize(memStream, eConnectDoc);
            memStream.Position = 0;
            XmlDocument myDoc = new XmlDocument();
            myDoc.Load(memStream);

   txtUsername.Text = eConnectObject.eConnect_Requester(connectionString, EnumTypes.ConnectionStringType.SqlClient, myDoc.OuterXml);// error shown in this line

Is there is any other method to retrieve the specified data (other than the last line)?

 

*This post is locked for comments

  • Re: Re: Re: pls review my code for gp connection

    login failed pblm is solved.  now the error is "invalid command send to execute xmlreader.".pls help me..

  • Re: Re: pls review my code for gp connection

    Yes, I have login set up for domain account on the SQL box..But, I don't know about the second thing..what is DYNGRP? and how can I assign the account to the DYNGRP?,,,pls explain me

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: pls review my code for gp connection
    Have you set up a login for your domain account on the SQL box and assigned it to the DYNGRP on the DYNAMICS and company Databases?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans