locked
Unable to understand connection string with metadata tag RRS feed

  • Question

  • User2015884762 posted

    Hi,

    I am trying to troubleshoot an application created by the vendor. I have got this connection string located in the config file and I don't understand how it works.  The thing is, I dont have access to the source code, merely getting the exe to work on a different computer. Right now the exe does not even get launched. 

    This is the connection string located at the working pc, I now need to get this up and running on a different pc. What does the metadata mean in the connection string and where can I find the ManrolandModel.csdl., are those files ? I tried searching and I cant search them. 

    <add name="ManrolandEntities" connectionString="metadata=res://*/ManrolandModel.csdl|res://*/ManrolandModel.ssdl|res://*/ManrolandModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=Manroland\SQLEXPRESS;initial catalog=GND_Local_Manroland;persist security info=True;user id=XXX;password=XXXX;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

    Monday, June 17, 2019 4:39 AM

All replies

  • User283571144 posted

    Hi callykalpana,

    callykalpana

    What does the metadata mean in the connection string and where can I find the ManrolandModel.csdl., are those files ? I tried searching and I cant search them. 

    As far as I know, the meta data is normally used in EF database first application.

    From MSDN article:

    Adding the validation attributes directly to the model class works when you do not expect the database to change; however, if your database changes and you need to regenerate the model class, you will lose all of the attributes you had applied to the model class. This approach can be very inefficient and prone to losing important validation rules.

    To avoid this problem, you can add a metadata class that contains the attributes. When you associate the model class to the metadata class, those attributes are applied to the model. In this approach, the model class can be regenerated without losing all of the attributes that have been applied to the metadata class.

    Normally, this class is created in the data model folder and will be built in your current web application's dll file.

    Best Regards,

    Brando

    Monday, June 17, 2019 7:58 AM
  • User753101303 posted

    Hi,

    They are embedded inside a DLL found in the bin directory. Anyway this is the embedded "provider connection string" that should be changed (and which is just the kind of connection string you are likely used to).

    Sunday, July 7, 2019 9:01 AM