I have VB6 Library and Windows Based Application i just want to convert it into C# Language and on C# language i am quite New i just created the SQL Connection string
but if i want to get data in VB6 i use ADOB.Recordset and i use function like this
//VB6 Code for getting MAXID from DATABASE
Public function MaxID(ColName as String, Table as String) as long
Dim recset as ADOB.Recordset
set recset =Conec.Execute("Select max(" & Colname & ")+1 as maxno from " & table
if Not recset.EOF Then
MaxID= iif(isNull(recset ! maxNo), 1 , recset ! maxNo)
Else
MaxID = 1
End If
Set recset= Nothing
End Function
and now i just need that how to convert above VB6 code in C# and one more question that in VB6 we can add Modules where i can save all my Public functions for all forms and in C# how can we use one main file like VB6 help me guys
Thanks in Advance

Shakti Singh DulawatRank #668 · 3.6K reputationPosted Aug 12, 2017, 1:31 AM EDT
OR
Best way is convert vb 6.0 to vb.net and than c#
Kailash Polai195 reputationPosted Aug 12, 2017, 1:37 AM EDT
Khan Baba22 reputationPosted Aug 12, 2017, 2:34 AM EDT
Ibrahim SiddiqueRank #1,837 · 807 reputationPosted Aug 14, 2017, 5:27 AM EDT