Catalog Name Overwriting

Posts   
 
    
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 07-Nov-2013 06:15:29   

LLBLGEN 4.0 LLBLGEN Runtime framework MYSQL C# Windows Application

Hi,

Little confused on this. below is what I am trying to do. How do i change server name, port, user name and password in overwrite ?


<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <configSections>
    <section name="mySqlCatalogNameOverwrites" type="System.Configuration.NameValueSectionHandler" />
  </configSections>
  <appSettings>
    <add key="ConnectionString.MySql (MySqlDirect)"
         value="Server=localhost;Port=3306;Database=myclub;User ID=club;Password=u78ribys;" />
    <add key="SecurityKey" value="q33~j}FjQat" />
  </appSettings>
  <mySqlCatalogNameOverwrites>
    <add key="myclub" value="myclub" />
  </mySqlCatalogNameOverwrites>

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 07-Nov-2013 06:27:15   

You should Catalog Name Overwrites if some catalog (database) name is different in the 'real life' (production) while your dev catalog name is other. For instance you have Northwind in your Dev machine and NorthProd in your production server. In that case you should use

<mySqlCatalogNameOverwrites>
    <add key="Northwind" value="NorthProd" />
</mySqlCatalogNameOverwrites>

You cannot change port, password or other connection string parameter in catalog overwrites. If you want that, just change you connection string in the .config file. If you don't know the port, user or password in advance (that info in known at runtime, like user input, etc) you could build your connection string at runtime and pass it to the DataAccessAdapter constructor, like:

using (var adapter = new DataAccessAdapter(myConnString))
{
     //...
}

Hope that helps wink

David Elizondo | LLBLGen Support Team
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 07-Nov-2013 07:19:21   

daelmo wrote:

You should Catalog Name Overwrites if some catalog (database) name is different in the 'real life' (production) while your dev catalog name is other. For instance you have Northwind in your Dev machine and NorthProd in your production server. In that case you should use

<mySqlCatalogNameOverwrites>
    <add key="Northwind" value="NorthProd" />
</mySqlCatalogNameOverwrites>

You cannot change port, password or other connection string parameter in catalog overwrites. If you want that, just change you connection string in the .config file. If you don't know the port, user or password in advance (that info in known at runtime, like user input, etc) you could build your connection string at runtime and pass it to the DataAccessAdapter constructor, like:

using (var adapter = new DataAccessAdapter(myConnString))
{
     //...
}

Hope that helps wink

So what I understand is DB name can be changed using catalog overwrite. Server name, user name and password can directly be changed in the initial connection string. Is this correct

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 08-Nov-2013 05:02:56   

Yes.