请使用数据库VB6代码将C#返回 [英] Please work with database VB6 code to C # back

查看:64
本文介绍了请使用数据库VB6代码将C#返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一台服务器-客户端写.我编写了一个VB6客户端应用程序,要使用C#编写服务器.

(
客户端应用程序Pic

服务器应用程序Pic
)

我在伊朗论坛上问了这个问题,但似乎没人回答我

请使用数据库VB6代码到C#返回

1-Dataname.Recordset.AddNew
2-Dataname.Recordset.Delete
3-Dataname.Recordset.Move(5)
4-Dataname.Recordset.Update
5-Dataname.RecordSource =从表名中选择*,其中名称=``sara''"
6-数据名.刷新

对不起,我的英语不好.

解决方案

很难理解您的问题,但我想您对使用数据库技术很感兴趣.看看 http://www.codeproject.com/KB/database/ [client application Pic

Server application Pic
)

I asked this question in the Iranian forum but nobody seems to answer my

Please work with database VB6 code to C# back

1-Dataname.Recordset.AddNew
2-Dataname.Recordset.Delete
3-Dataname.Recordset.Move (5)
4-Dataname.Recordset.Update
5-Dataname.RecordSource = "select * from TableName where name = ''sara'' "
6-Dataname.Refresh

I''m sorry my English is not good

解决方案

It is a bit difficult to understand your problem, but I am guessing you are interested in using database technology. Take a look at http://www.codeproject.com/KB/database/[^], for some samples.


If it is your intention to convert VB6 code to C# code then this means that your database interaction will change thouroughly and in fact you have multiple options.
1. The most simple option is to use ADO.NET.
In this case you have to create a dataset at design time, where you can add queries to your dataset at design time. This will create a whole lot of classes for you like a datatable and an adapter for each table you add to the dataset.
You can even add contraints to these tables. This way of working is called disconnected database access, because you are fetching the data and loading it in memory. If you ever change it and want to update the database you also use the adapters to do that, and they will just create a connection as they need it. The connection establishment to the database is transparent to the user.
2. This option is a little more advanced and cannot be applied for all databases because it is not supported by all of them. It is using an entity framework. But if you are a novice I''d recommend the first approach more than the second. It depends on the size of the application. For a big application with many tables this might be the way to go. But it will require you to build up some skills.


这篇关于请使用数据库VB6代码将C#返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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