vb6到vb.net [英] vb6 to vb.net

查看:95
本文介绍了vb6到vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是vb6用户,我想在vb.net中进行更改,我在vb.net中的Eof中有问题!!!

设置tempRs = gCnn.Execute(从finance_reports.rep_stud_name中选择StudentId;")
虽然不是tempRs.EOF
设置temp_Update_rs = gCnn.Execute(选择与众不同的*来自finance_reports.rep_stud_Others,其中StudentId ="& tempRs.Fields(0).Value&";")
使用temp_Update_rs
虽然不是.EOF
gCnn.Execute(更新finance_reports.rep_statement1设置其他"& countX&"="& Replace(.Fields(1).Value,"'',"'''')&"' ',O_Amount& countX&" =& CCur(.Fields(2).Value)&" Where StudentID ="& tempRs.Fields(0).Value&";")
.MoveNext
countX = countX +1
温德
结尾为
temp_Update_rs.CloseRecordset
设置temp_Update_rs = Nothing
countX = 1
tempRs.MoveNext
温德
tempRs.CloseRecordset
设置tempRs = Nothing



我要如何在vb.net中写这篇文章,我想在vb.net中更改一个vb6开发人员?


请先使用vb.net和mysql给我EOF中的示例代码!!!!!!!!……..

电子邮件:wangbu889@yahoo.com

im vb6 user im want change in vb.net i ahve a problem in Eof in vb.net!!!!

Set tempRs = gCnn.Execute("Select StudentId From finance_reports.rep_stud_name;")
While Not tempRs.EOF
Set temp_Update_rs = gCnn.Execute("Select distinct * From finance_reports.rep_stud_Others Where StudentId=''" & tempRs.Fields(0).Value & "'';")
With temp_Update_rs
While Not .EOF
gCnn.Execute ("Update finance_reports.rep_statement1 Set Others" & countX & "=''" & Replace(.Fields(1).Value, "''", "''''") & "'',O_Amount" & countX & "=" & CCur(.Fields(2).Value) & " Where StudentID=''" & tempRs.Fields(0).Value & "'';")
.MoveNext
countX = countX + 1
Wend
End With
temp_Update_rs.CloseRecordset
Set temp_Update_rs = Nothing
countX = 1
tempRs.MoveNext
Wend
tempRs.CloseRecordset
Set tempRs = Nothing



how count i write this in vb.net im a vb6 developer i want to change in vb.net?


plz give me sample codes in EOF using vb.net and mysql!!!!!!!!thnks in advance........

email:wangbu889@yahoo.com

推荐答案

您需要将所有这些都扔掉.您似乎正在使用ADO.别.使用ADO.NET返回数据集,然后使用它们.

另外,使用参数化查询来处理转义SQL语句等.要离开VB6的时间已经晚了几年,但这绝不是一个坏时机.只需避免使用VisualBasic命名空间,即可学习以.NET方式进行操作.此代码需要完全废弃,并用.NET代码替换.
You need to throw all of this out. You seem to be using ADO. Don''t. Use ADO.NET to return DataSets and then work with those.

Also, use parameterised queries to handle escaping your SQL statements etc. You''re a few years late to be getting out of VB6, but it''s never a bad time. Just avoid the VisualBasic namespace, so you can learn to do things the .NET way. This code needs to be totally scrapped and replaced with .NET code.


这篇关于vb6到vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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