Inhalte aufrufen

Profilbild

Multiple Database Support

multiple Database

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
8 Antworten zu diesem Thema

#1 ashishk84

ashishk84

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 15 July 2015 - 12:54

Could I create another database in smartstore..?

how to do please explain me



#2 Michael Herzog

Michael Herzog

    SmartStore AG

  • Administrators
  • 3497 Beiträge

Geschrieben: 15 July 2015 - 17:06

Hi,

 

and welcome to our forum ;-) 

 

Do you want to establish load balancing with another database?

 

Regards,

Michael Herzog


Michael Herzog
Smartstore AG


#3 ashishk84

ashishk84

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 16 July 2015 - 05:50

Hello

 

Thanks for your quick response..

 

What I want to do is connect the smartstore to my existing website database.

so that I could use my existing ewalllet table in payment method..



#4 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 16 July 2015 - 15:57

Your question is very vague. It's like "how can I write software";)

 

Do you intend to develop your own payment plugin which should use supplementary data from another database? If yes, you're free to implement your custom DbContext with a connection string pointing to your database. Please understand that I can't explain in detail how to use Entity Framework.

 

If you have concrete questions though, don't hesitate to ask.


Murat Cakir
SmartStore AG


#5 ashishk84

ashishk84

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 16 July 2015 - 17:28

Yes I know that.. But I want to the how and where to define my custom DBContext

and how to define my second connection string.? Could you please show me some code?



#6 julioz07

julioz07

    Newbie

  • Members
  • Punkt
  • 8 Beiträge

Geschrieben: 09 December 2016 - 11:01

Hi i would like to clear the same question but with some differences!

 

Is it possible to link another database to the smart store one? We already have a huge database of products from the previews website and our billing software, they share information.

 

Is it possible to link them (the old one and the new one form smart store)?  They have different collation, but i would like to at least import all of my information from the old database, and maybe insert some new fields on the smart store database.



#7 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 09 December 2016 - 11:54

You can link another database by just changing the connection string in App_Data/Settings.txt but you cannot tell the store to get the data from multiple databases thus connection strings at the same time.

Marcus Gesing

Smartstore AG


#8 julioz07

julioz07

    Newbie

  • Members
  • Punkt
  • 8 Beiträge

Geschrieben: 09 December 2016 - 13:24

 

You can link another database by just changing the connection string in App_Data/Settings.txt but you cannot tell the store to get the data from multiple databases thus connection strings at the same time.

 

 

Thank you very much. I will try to work with that!



#9 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 09 December 2016 - 18:15

You can however connect to as many databases as you want in parallel. You just have to:

  • Create your own context class anywhere in code or in your custom plugin, which derives from DbContext, or ObjectContextBase (which itself derives from DbContext).
  • Instantiate your own context whenever you need access to your database with a custom connection string.

Murat Cakir
SmartStore AG