Results 1 to 7 of 7

Thread: Value conversion error between solutions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2001
    Posts
    107

    Value conversion error between solutions

    I've got 3 errors in my app level that say something like:

    C:\Programming\DBFTPUpload_App\DBFTPUpload_App\ConsoleApplication1\DBFTPUpload.vb(52): Value of type 'ws.si.search.User' cannot be converted to 'ConsoleApplication1.ws.si.JobManager.User'.
    The first line of code responsible for two of the errors is:
    Dataset = m_wsJobManager.PolicySearch(GetUser(m_User), CreatePolicySearchRequest)

    GetUser creates a temporary user, populating tmpUser (a private user object) with username, password, and network credentials. It then returns tmpUser.

    The next error occurs in the call to CreateSearchRequest, a function of type SearchRequest that builds a search request. That request is then sent in the above line of code in order to fill a DataSet.

    The final error is in the User object as I try to pass it to our web services layer. I get the same exact error for each of the above examples.

    What am I doing wrong? I'm having a terrible time trying to figure it out.

    Thanks a lot,
    Mike

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    It sounds like the types are in two different assemblies and aren't related (thru inheritance) so it can't convert them.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2001
    Posts
    107
    So how would I resolve something like that?

    I'm trying to do essentially the same thing as other solution-to-solution projects, and I even have the same references and everything..

    Thanks,
    Mike

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    How are 'ws.si.search.User' and 'ConsoleApplication1.ws.si.JobManager.User' related?

    You can either use the same type on both, Making them Comparable through an IComparable implementation (I think you can do that not sure though), or if one extended the other then have it inherit the parent and it will be convertable then.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2001
    Posts
    107
    How are 'ws.si.search.User' and 'ConsoleApplication1.ws.si.JobManager.User' related?
    ws.si.search.User is a reference to the User object in the ws.si.search web service. ConsoleApplication1 is my app, and I'm trying to create the user object from that end, and passing it along through the web service to the Interop layer.

    I just realized that one of my problems was that I was basically creating redundant objects, which could be part of the problem. They're both essentially the same User objects, but originating in different classes, I guess. So I eliminated one of the errors by changing the function CreatePolicySearchRequest to be of type ws.si.JobManager.PolicySearchRequest instead of ws.si.search...

    I basically was able to eliminate the rest of the errors in the same fashion...time will tell if that was a "legal" move or not!

    Thanks a lot,
    Mike

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Sorry I wasn't very clear but that is what I meant by 'You can ... use the same type on both'. Seems like a perfectly legal move to me.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2001
    Posts
    107
    Legal in that it's not giving me errors, yes, but in terms of our project architecture, we shall see.

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width