如何使用c#3.0为访问数据库设计包装器?

时间:2022-09-27 13:59:01

i have only very limited exposure with .net 1.1 and a bit of 2.0, so i'm actually pretty excited and confused with the many changes that they have in .net 3.5. so i have this access database but we don't want the other programs from calling into this database directly. so i'm writing a wrapper exe which will contains functions which can be call by the other program to return data (ala web service style).

我只有非常有限的曝光与.net 1.1和一点2.0,所以我真的非常兴奋和混淆他们在.net 3.5中的许多变化。所以我有这个访问数据库,但我们不希望其他程序直接调用这个数据库。所以我正在编写一个包装器exe,它将包含可由其他程序调用以返回数据的函数(ala web服务样式)。

so for now i have manage to create a console app, encrypted the connection string and pull some data from the database.

所以现在我已经设法创建一个控制台应用程序,加密连接字符串并从数据库中提取一些数据。

  1. how do i make it so that the other programs can call this exe's function?
  2. 我如何使它,以便其他程序可以调用此exe的功能?

  3. how do i return the appropriate data to the calling program?
  4. 如何将适当的数据返回给调用程序?

  5. and is there's something wrong or a better design for my case?
  6. 我的案子有什么不对或更好的设计吗?

i would love to learn from any dot net guys here :) thanks.

我很乐意向这里的任何网络人员学习:)谢谢。

1 个解决方案

#1


Why don't you use existing Data Access Layer technology to encapsulate the call to Access database?

为什么不使用现有的数据访问层技术来封装对Access数据库的调用?

I used Strongly typed datasets for Microsoft Access database before. And you can use NHibernate, too.

之前我使用过强类型的数据集用于Microsoft Access数据库。你也可以使用NHibernate。

#1


Why don't you use existing Data Access Layer technology to encapsulate the call to Access database?

为什么不使用现有的数据访问层技术来封装对Access数据库的调用?

I used Strongly typed datasets for Microsoft Access database before. And you can use NHibernate, too.

之前我使用过强类型的数据集用于Microsoft Access数据库。你也可以使用NHibernate。