Programming problem ! (SelectCommand) - InfoPath Dev
in

InfoPath Dev

Programming problem ! (SelectCommand)

Last post 02-12-2007 03:35 AM by Navid. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-10-2007 05:34 AM

    • Navid
    • Top 200 Contributor
    • Joined on 12-23-2006
    • Posts 54

    Programming problem ! (SelectCommand)

    Hi. I have an issue :
    I have Created a Table by coding in WebService (DataSet&DataTable). I want to Initialize the SelectCommand property but I Have an Error that said "The *Connection* property of *SelectCommand* hasn't been initialized !!".
    but u Know the table isn't in a DB and has created by coding . I think it shouldn't have any connection property !
    So what's the connection property ?????
    S.N.R
  • 02-10-2007 02:08 PM In reply to

    Re: Programming problem ! (SelectCommand)

    Hi Navid,

    Are you using InfoPath 2007 or InfoPath 2003? Do you know if you are using the new object model in 2007 or not?

    For universal data connections, the SelectCommand has the following structure:

    <udc:SelectCommand>
    <udc:ListId/>
    <udc:WebUrl/>
    <udc:ConnectionString/>
    <udc:OperationName/>
    <udc:ServiceUrl UseFormsServiceProxy=""/>
    <udc:SoapAction/>
    <udc:Query/>
    </udc:SelectCommand>

    For a Web service submit, you only need to specify the ServiceUrl and SoapAction. For example:

    <udc:SelectCommand>
    <udc:ListId/>
    <udc:WebUrl/>
    <udc:ConnectionString/>
    <udc:ServiceUrl UseFormsServiceProxy="true">http://formsboard.com:30794/dbxl/dbxldocumentserviceEx.asmx</udc:ServiceUrl>
    <udc:SoapAction>http://qdabra.com/webservices/SubmitDocument</udc:SoapAction>
    <udc:Query/>
    </udc:SelectCommand>

    There should be parallel properties when you set up the data connection in code (vs. UDC).

    I hope this helps you. Good luck.
    I thought SelectCommand contained info on connection string and SQL query to perform. For Web services, you shouldn't need it.
    Patrick Halstead
    Project Manager at Qdabra
  • 02-12-2007 12:37 AM In reply to

    • Navid
    • Top 200 Contributor
    • Joined on 12-23-2006
    • Posts 54

    Re: Programming problem ! (SelectCommand)

    Hi Patrick,
    I'm using InfoPath 2003 but I think this issue isn't related to infopath !
    I have created an ASP.Net Web Service that my forms are using this WS,and this WS is connected to a SQL 2005 DB.
    The goal was to creat a temporary table, initialze it , & copy it to a table in SQL DB.
    I Create the temporary table ==> DataTable table = new DataTable();
    then I created it's column's and it's rows. and then I initialze it.
    but when I wanted to query it, you now that I should initialze the Select command property.
    one of it's parameters is DataConnection. And I don't know what should I put instead of it !!
    it's been bolded below :
    SPDataAdapter.SelectCommand = new SqlCommand(@"Select ID From [table]",??Connection??);
    S.N.R
  • 02-12-2007 12:49 AM In reply to

    Re: Programming problem ! (SelectCommand)

    try the connection string to the DB
    Patrick Halstead
    Project Manager at Qdabra
  • 02-12-2007 12:52 AM In reply to

    • Navid
    • Top 200 Contributor
    • Joined on 12-23-2006
    • Posts 54

    Re: Programming problem ! (SelectCommand)

    Hi Patrick,
    I think I'm doing a simple mistake !!
    The temporary table isn't in DataBase, so there shouldn't be any dataAdapter and so on .
    Am I right ???
    if yes , how can I query this table ?! by searching rows and columns one by one ????
    S.N.R
  • 02-12-2007 01:20 AM In reply to

    Re: Programming problem ! (SelectCommand)

    Hi again,
    I don't understand the comment "the temporary table isn't in the Database". Anyway, sounds like it's not an InfoPath issue.
    Patrick Halstead
    Project Manager at Qdabra
  • 02-12-2007 03:35 AM In reply to

    • Navid
    • Top 200 Contributor
    • Joined on 12-23-2006
    • Posts 54

    Re: Programming problem ! (SelectCommand)

    I mean I have 2 kind of table .
    1- A real table in my SQL DB.
    2- A table that I create in WebMethods functions in my WebService. with c# commands like this command : DataTable temp = new DataTable();

    Now imagin u have 2 tables, one that is created in Database and the other one that is created in your WebService. ( like above )

    the structure of two tables are the same.

    The first one ( in DB ) is empty and the second one has been initialized.

    Main Question : In my WebService and With C# commands, How can I initialize the first table with the values in the second table ???

    S.N.R
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.