locked
Retrieve data from GP SQL server RRS feed

  • Question

  • Hi, Friends

                       I had write the following code to retrieve data from gp sql server..But an error "invalid command send to execute xmlreader"..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);

       string requestDoc= 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)?

     

    • Moved by Darren Green SQLIS Thursday, July 8, 2010 7:15 AM Not a SSIS related topic, hope this is a better home. (From:SQL Server Integration Services)
    Thursday, July 8, 2010 5:24 AM

Answers

  • I'd say you connection string is incorrect, the error would seem to fit. Try testing it using something simple like a UDL file, I assume it is comparable to whatever the eConnectXXXX stuff does.

    e.g. Create a file called MyFile.udl and double-click top open the UI. Make sure you start at the first tab and select SQL Server.

    Moving to a Dynamics Dev forum, as this is nothing to do with SSIS.


    http://www.sqlis.com | http://www.konesans.com
    • Marked as answer by Hari nvp Monday, July 12, 2010 12:03 PM
    Thursday, July 8, 2010 7:14 AM