Here is some code that I used to import some Win32 functions from a Kernel32.Dll. I would suspect you could use the same code (obviously modified) to solve your problem:
internal class Kernel32
{
[DllImport("kernel32.dll", SetLastError=true )]
public static extern int GetPrivateProfileString( string szApplicationName,
string szKeyName, string szDefault, StringBuilder szReturnValue, int nSize, string szFilename );
[DllImport("kernel32.dll", SetLastError=true )]
public static extern int GetPrivateProfileSectionNames( byte[] lpszReturnBuffer,
int nSize, string szFilename );
}
Maybe something like:
internal class ODBC32
{
[DllImport("kernel32.dll", SetLastError=true )]
public static extern short SQLSetConnectOption ( int hDbc, short iOption, int lValue);
}
Don't forget that the data types are differenent between c/c++ and c#. C#int = c++long
Good Luck,
Kevin
"pcPirate" <ph****@hotmail.com> wrote in message news:Oc**************@TK2MSFTNGP11.phx.gbl...
Hi,
Can anyone help me to convert the following VB6 code into C#???
Declare Function SQLSetConnectOption Lib "ODBC32.DLL" (ByVal hDbc As Long,
ByVal iOption As Integer, ByVal lValue As Long) As Integer
Thanks in advance
pcPirate