locked
the new command text returns data with schema different from the main query RRS feed

  • Question

  • User-504098406 posted

    Hi,

    I created a table adapter query that should return all data depending on what is entered. for expamle if I put in my first name text box the letter "S", it should return all records whose first name begins with "S". However, when i create query I get the above mentioned message and when I click to preview the data and enter the information as above, it does not return all records as desired. I checked the query itself and that was ok.

    Asking for assistance please.

    Thursday, April 4, 2013 11:47 AM

Answers

  • User1873438307 posted

    Well, the query will return the following

    DateRegistered
    Email
    FirstName
    LastName
    PotentialCustNo
    ReferredByCat
    TelephoneNumber1
    TelephoneNumber2

    Which is different from your tableadapter schema, that's why you are getting this exception. Either modify your query to return the same schema or create another tableadapter with your query

    Also, if you want to search for any existence of 'b' lets say, change the Where clause to look like the following:

    (PotentialCustomers.FirstName LIKE '%' + ? + '%') AND (PotentialCustomers.LastName LIKE '%' + ? + '%')




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 4, 2013 5:40 PM

All replies

  • User1873438307 posted

    This message indicates that your results could not be filled in your table adapter's model you are working on.

    Please post your sql query and the schema of the tableadapter datatable

    Thursday, April 4, 2013 5:14 PM
  • User-504098406 posted

    SQL Code

    SELECT        PotentialCustomers.DateRegistered, PotentialCustomers.Email, PotentialCustomers.FirstName, PotentialCustomers.LastName, PotentialCustomers.PotentialCustNo, 
                             ReferredBy.ReferredByCat, PotentialCustomers.TelephoneNumber1, PotentialCustomers.TelephoneNumber2
    FROM            PotentialCustomers INNER JOIN
                             ReferredBy ON PotentialCustomers.ReferredByID = ReferredBy.ReferredByID
    WHERE        (PotentialCustomers.FirstName LIKE ?) AND (PotentialCustomers.LastName LIKE ?)

    Schema of tableadapter datatable (not sure if I am answering this part but here goes)

    PotentialCustNo

    FirstName

    LastName

    Email

    TelephoneNumber1

    TelephoneNumber2

    FirstContacted

    Status

    ReferredByID

    ExistingCustName

    Thursday, April 4, 2013 5:33 PM
  • User1873438307 posted

    Well, the query will return the following

    DateRegistered
    Email
    FirstName
    LastName
    PotentialCustNo
    ReferredByCat
    TelephoneNumber1
    TelephoneNumber2

    Which is different from your tableadapter schema, that's why you are getting this exception. Either modify your query to return the same schema or create another tableadapter with your query

    Also, if you want to search for any existence of 'b' lets say, change the Where clause to look like the following:

    (PotentialCustomers.FirstName LIKE '%' + ? + '%') AND (PotentialCustomers.LastName LIKE '%' + ? + '%')




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 4, 2013 5:40 PM