数据库访问应用程序 [英] Database access application

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

问题描述

嘿研究员,

我正在研究一个小型应用程序(WPF),该应用程序从传入的数据库中读取数据并将其放入本地数据库中.

例如,我从传入的数据库中获取客户名称,电话和电子邮件,然后将其放入我的本地数据库中.

该应用程序具有表示层,用户可以在该表示层上单击并执行此功能.还可以使用一个数据网格查看加载的内容.

这两个数据库都是Microsoft SQL Server 2008,并且具有相同的结构.
连接字符串存储在app.config文件中.目前,该应用程序可以正常运行.

现在,我需要以一种不必担心传入的DBMS的方式编写应用程序.它可以是Oracle,PostgreSQL,MySql等.


需要/计划做什么...

1)用户具有文本框,他可以在其中创建/保存本地数据库/配置文件中的连接字符串值.
2)然后,应用程序应使用它来形成连接字符串并连接到传入的数据库.
3)检索值并将其放在本地数据库中.
4)无需将数据写入传入数据库.仅1路.

简而言之,一个独立于数据库的应用程序只能根据一组查询读取值,并将其放入指定的数据库中.


有可能做到这一点或听起来很神奇吗?
我可以开发任何解决方案/样品/技术吗?
现在它也是在WPF上开发的,但是需要迁移到Silverlight.

让我知道我是否不清楚.

Cheers

Hey Fellow Coders,

I''m working on a small application(WPF) which reads data from an incoming database and puts it into local database.

For instance I get the customer name, phone and email from incoming database and then put it into my local database.

The application has presentation layer where the user is able to click and perform this function.Also a datagrid to view the loaded content.

Both the databases are Microsoft SQL Server 2008 and have same structure.
The connection string is store in the app.config file. At present the app works just fine.

Now I need to write the app in such a way that it should not worry about the incoming DBMS. It can be Oracle, PostgreSQL, MySql etc..


What is needed/planning to do...

1) The user has textbox(s) where he is able to create/save the connection string vales in the local database/config file.
2) The application then should use this to form the connection string and connect to the incoming database.
3) Retrieve the values and put them in the local database.
4) No need to write data to the incoming database.Only 1-way.

In short a database independent application to only read values based on a set query and put them in the specified database.


Is it possible to do this or sounding magical?
Any solutions/sample/technique I can develop on?
Also right now its developed on WPF but need to move to Silverlight.

Let me know if I''m not being clear..

Cheers

推荐答案

实现数据库独立性"的常用方法是使用ORM(对象关系映射器),例如LLBLGen,Entity Framework或NHibernate.
The common approach toward achieving ''database independance'' is to use an ORM (Object-relational mapper) such as LLBLGen, Entity Framework, or NHibernate.


这篇关于数据库访问应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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