-3

Public function MaxID(ColName as String, Table as String) as long

' Here i make a local Variable Dim recset as ADOB.Recordset

set recset =Conec.Execute("Select max(" & Colname & ")+1 as maxno from " & table end if Set recset= Nothing End Function

Khan Baba
  • 1
  • 2
  • Good Day Guys, 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 – Khan Baba Aug 12 '17 at 07:16
  • Stack Overflow is not a code generator site. Please try it youself or use an online tool. http://converter.telerik.com – H. Pauwelyn Aug 12 '17 at 07:29
  • @KhanBaba 1) the comment you added in your own question, this should have been a part of the question text, 2) You cant ask for a full translation of the function, this doesnt make for a good question, you can ask for a particular part of what you are trying to do and do the rest yourself, your question will soon be deleted, hope you read this before it gets deleted. – user734028 Aug 12 '17 at 08:35

1 Answers1

0

The ADODB Library was replaced with the ADO.Net Library in .Net. So too move ahead quickly i suggest to use a helper class which nearly will be the same as in ADODB I suggest to find a helper class like Using SqlHelper class in ASP.Net Tutorial with examples in C# and VB.Net

Tareq
  • 1,397
  • 27
  • 28