Menu

XML mapping for SQL Server issue

2004-05-18
2004-05-18
  • Hans Van Eylen

    Hans Van Eylen - 2004-05-18

    I'm trying to get the AtomsFramework with the SharpDevelop environment and SQL Server.

    For now I just use one class CCustomer. My SQL Server is called "VESYS", the database is "test" and I have two tables : OID and Customer.

    This is my xml file :
    <?xml version="1.0" encoding="utf-8" ?>
    <map>
        <database name="VESYS" class="CMsSqlDatabase">
            <parameter name="name" value="test" />
            <parameter name="user" value="Hans" />
            <parameter name="password" value="mypassword" />
            <parameter name="OIDTable" value="OID"/>
        </database>
        <class name="CCustomer" table="Customer" database="test">
            <attribute name="OIDValue" column="oid" key="primary"/>
            <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/>
            <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/>
            <attribute name="CustomerID" column="CustomerId" find="true" proxy="true"/>
            <attribute name="Company" column="Company" proxy="true"/>
            <attribute name="ContactName" column="ContactName"/>
            <attribute name="Country" column="Country"/>
            <attribute name="Address1" column="Address1"/>
            <attribute name="Address2" column="Address2"/>
            <attribute name="City" column="City"/>
            <attribute name="Zipcode" column="Zipcode"/>
            <attribute name="Country" column="Country"/>
            <attribute name="Telephone" column="Telephone"/>
            <attribute name="Fax" column="Fax"/>
            <attribute name="Rate" column="Rate"/>
            <attribute name="VatNumber" column="VatNumber"/>
            <attribute name="PaymentTerms" column="PaymentTerms"/>
          </class>
    </map>

    I have one form (basically the one from the tutorial) but when I run it I get this error :

    ************** Exception Text **************
    System.Exception: Error retrieving storage information for column oid in class CCustomer in database mapping .XML file.
       at AToMSFramework.CXMLConfigLoader.getClassMap(XmlElement node)
       at AToMSFramework.CXMLConfigLoader.IConfigLoader_loadConfig(HybridDictionary& dbMap, HybridDictionary& clMap)
       at AToMSFramework.CPersistenceBroker.loadConfig(_IConfigLoader configLoader)
       at AToMSFramework.modPersistenceBrokerSingleton.getPersistenceBrokerInstance(String xmlfile)
       at AToMSFramework.CPersistenceBroker.init(String xmlfile)
       at VesysAdmin.frmCustomer..ctor() in c:\Documents and Settings\Hans\My Documents\SharpDevelop Projects\TestORM\frmCustomer.cs:line 45
       at VesysAdmin.MainForm.ButtonClick(Object sender, EventArgs e) in c:\Documents and Settings\Hans\My Documents\SharpDevelop Projects\TestORM\MainForm.cs:line 46
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

     
    • Hans Van Eylen

      Hans Van Eylen - 2004-05-18

      problem solved. The connection info was not correct. I was confused as it was referring to the CCustomer class and not the connection.

      Hans

       
    • Richard Banks

      Richard Banks - 2004-05-18

      I assume you changed the database attribute for CCustomer to VESYS instead of test.

      If you have any other questions please feel free to ask.

      - Richard.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.