从另一个数据库获取价值 [英] Get value from another database

查看:60
本文介绍了从另一个数据库获取价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的要求是,

DatabaseName:Eros

表名:ABTypeNumber

FiledName:Id,ABType,ABNumber。



另一个DatabaseName:IBP

TableName:ABRecord

FieldName:ID,ABType,ABNumber,Amount,TargetAudience,Product。





何时,记录将在ABType IN IBP,此ABType的ABNumber将来自Eros数据库。





希望您理解。



我尝试了什么:



我无法理解我将如何开始。请给我建议。

Hi,

My requirements are,
DatabaseName: Eros
Table Name: ABTypeNumber
FiledName: Id, ABType,ABNumber.

Another DatabaseName:IBP
TableName: ABRecord
FieldName: ID, ABType, ABNumber, Amount, TargetAudience, Product.


When, the record will be generate under the ABType IN IBP, ABNumber of this ABType will come from Eros Database.


Hope You Understand.

What I have tried:

I can't understand how will i start. Please give me suggestion.

推荐答案

你在这里做的是跨数据库。如果您只是谷歌,您应该了解如何使用您正在使用的任何提供商。我建议您在这种情况下使用存储过程生成行,因为您无法控制跨数据库参照完整性。



如果您不想这样做而你只是想通过C#来实现它,你只需从你需要的每个数据库中提取数据然后插入到任何数据库中。



如果你正在寻找关于如何使用ADO.NET或EF,那么你需要自己做研究。
What you're doing here is cross-database. If you just Google that you should find out how to do it with whatever provider you're using. I recommend that you use stored procedures to generate rows in that case because you can't control cross-database referential integrity.

If you don't want to do that and you're just going to do it through C#, you simply pull the data down from each database you need then insert into whichever database.

If you're looking for how to use ADO.NET or EF, then you need to do research on those yourself.


这篇关于从另一个数据库获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆