I have two databases now. One is nopCommerce's database, another is mine. Because I have some special tables and it is used by another website. How c

1 个月 前
I have two databases now. One is nopCommerce's database, another is mine. Because I have some special tables and it is used by another website. How can to  connect another database In nopcommerce 4.3 Please Help !
1 个月 前
"connect" in what way?  If you want to access/query the other DB from inside nopCommerce code, you will need to use SQL.   Is the other DB in the same SQL Server instance?

You may be able to inject INopDataProvider dataProvider, and then
_dataProvider.Query<YourClass>(sql, sqlParams)
1 个月 前
 
private readonly IRepository<MemberAccount> _memberAccountRepository;


var query = from c in _memberAccountRepository.Table
                        orderby c.DisplayOrder
                        where c.Published &&
                        !c.Deleted
                        select c;
        



A member account is a table which is in another database
And when i excute the result it's show me the error
"Invalid Object Name"..
1 个月 前
It's because "a table which is in another database" is not in the same db context.  Can you create a View in your nopCommerce database that refers to table in the other database?