Click here to Skip to main content
15,041,525 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 3-Jan-10 19:44pm
v2

1 solution

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.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900