The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Keyword not Supported

Last post 06-13-2008, 10:15 AM by TedA. 8 replies.
Sort Posts: Previous Next
  •  06-10-2008, 12:03 PM 9733

    Keyword not Supported

    Error Message

    ArgumentException was unhandled

    Keyword not supported
    Parameter name: id

    Code:
                Dim dmscustomerid As Long = -1
                Dim cust As New Modus21.Customer
                cust.es.Connection.ConnectionString = MySQLDal.Global.GetModus21Connectionstring
                cust.Query.Where(cust.Query.ModusCustomerID.Equal(ModusCustomerID))
                If cust.Query.Load Then
                    If Not IsNothing(cust.DMSCustomerID) Then
                        dmscustomerid = cust.DMSCustomerID
                    End If
                End If
                Return dmscustomerid

    I request assitance with this error message. The exception is thrown on the query.load call.

    I'm not sure what from the error message what is causing the issue.

    EntitySpaces Version # 2007.0.0528.0
    MyGeneration Version # 1.2.0.7
    Visual Studio 2005
    MySQL Server 6.0
    MySQL Connector 5.2.1

  •  06-10-2008, 12:15 PM 9734 in reply to 9733

    Re: Keyword not Supported

    Well, I'm not sure, do a try catch and look at cust.Query.es.LastQuery and post that for us. Also, you are manually setting the connection string, it was never meant to be used that way, you are really supposed to set the Connection.Name.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-10-2008, 12:27 PM 9736 in reply to 9734

    Re: Keyword not Supported

    Last Query is

       LastQuery "SELECT * FROM `customer` WHERE (`ModusCustomerID` = ?ModusCustomerID1 )" String

     

    I changed the line

    cust.es.Connection.ConnectionString = MySQLDal.Global.GetModus21Connectionstring

     to

    cust.es.Connection.Name = "Modus"

    But we still get the same error message.

    Edit: I ran the Last Query in my MySQL Query Browser, replacing ?ModusCustomerID with one of our CustomerIDs and the query ran without issue.

  •  06-10-2008, 2:33 PM 9742 in reply to 9736

    Re: Keyword not Supported

    A quick Google search on that error seems to indicate that the keyword that is not supported is in the connection string. What does your connection string look like, without the password, of course?
    David Neal Parsons
    www.entityspaces.net
  •  06-11-2008, 9:11 AM 9757 in reply to 9742

    Re: Keyword not Supported

    Your google searched turned up more than my (other search engine) did. 

    Connection String is "datasource=127.0.0.1;Initial Catalog=modusstagingdatabase;id=imnot;Password=tellingyou"

     Oh my goodness. It's got to be User Id, not Id!

    /bangheadondesk

  •  06-11-2008, 10:22 AM 9760 in reply to 9757

    Re: Keyword not Supported

    connectionstrings.com is a handy site to use for cnn string references, as they all tend to be slightly different.

    Regards,

    Scott Schecter
    EntitySpaces | My Site
  •  06-12-2008, 11:56 AM 9785 in reply to 9757

    Re: Keyword not Supported

    The problem now seems to be that I'm getting a NullReferenceException on the get_CommandTimeout when I call the Query.Load.

    I made sure Metadata Class Should Ignore Schema was checked and MetaData Class Should Ignore Catalog was checked when I generated the classes. I also check Target Multiple Databases.

    This is my InitializeEntitySpaces Sub

     

    Code:
    1    EntitySpaces.Interfaces.esProviderFactory.Factory = New EntitySpaces.LoaderMT.esDataProviderFactory()
    2    
    3                m_connstring = My.Settings.ConnectionString
    4                Dim conn As New EntitySpaces.Interfaces.esConnectionElement
    5                conn.ConnectionString = m_connstring
    6                conn.Name = "Live"
    7                conn.Provider = "EntitySpaces.MySqlClientProvider"
    8                conn.ProviderClass = "DataProvider"
    9                conn.SqlAccessType = EntitySpaces.Interfaces.esSqlAccessType.DynamicSQL
    10               conn.ProviderMetadataKey = "esDefault"
    11               '// Assign the Default Connection
    12               EntitySpaces.Interfaces.esConfigSettings.ConnectionInfo.Connections.Add(conn)
    13               EntitySpaces.Interfaces.esConfigSettings.ConnectionInfo.Default = "Live"
    14   
    15               Dim modconn As New EntitySpaces.Interfaces.esConnectionElement
    16               conn.ConnectionString = "datasource=127.0.0.1;Initial Catalog=modusstagingdatabase;User Id=blah;Password=blah"
    17               conn.Name = "Modus"
    18               conn.Provider = "EntitySpaces.MySqlClientProvider"
    19               conn.ProviderClass = "DataProvider"
    20               conn.SqlAccessType = EntitySpaces.Interfaces.esSqlAccessType.DynamicSQL
    21               conn.ProviderMetadataKey = "esDefault"
    22   
    23               EntitySpaces.Interfaces.esConfigSettings.ConnectionInfo.Connections.Add(modconn)
    
  •  06-12-2008, 5:03 PM 9794 in reply to 9785

    Re: Keyword not Supported

    For your second connection, you "Dim" a different object "modCon" and add it, but the code in between is still using "conn". It's not necessary for the name of the object to be different. The fact that conn.Name is different is sufficient.

    See this FAQ for an example configless approach with two connections:

    http://community.entityspaces.net/forums/thread/4769.aspx

    Do not check "Target Multiple Databases". See the description of that option in the "Getting Started" PDF, or the more detailed explanation if Multi-provider mode in this FAQ:

    http://community.entityspaces.net/forums/thread/3136.aspx

    We probably should change the name of that option in the template to "Target Multiple Providers" to avoid confusion.


    David Neal Parsons
    www.entityspaces.net
  •  06-13-2008, 10:15 AM 9812 in reply to 9794

    Re: Keyword not Supported

    David, I'm glad it's Friday.

     Thank you for your help.

View as RSS news feed in XML