Help with Converting C#.Net to VB.Net

R

Rob Panosh

Could somebody please assist me in converting the following C#.Net code to
VB.Net code?

[DllImport("odbc32.dll")]
private static extern short SQLAllocHandle(short hType, IntPtr inputHandle,
out IntPtr outputHandle);
[DllImport("odbc32.dll")]
private static extern short SQLSetEnvAttr(IntPtr henv, int attribute, IntPtr
valuePtr, int strLength);
[DllImport("odbc32.dll")]
private static extern short SQLFreeHandle(short hType, IntPtr handle);
[DllImport("odbc32.dll",CharSet=CharSet.Ansi)]
private static extern short SQLBrowseConnect(IntPtr hconn, StringBuilder
inString, short inStringLength, StringBuilder outString, short
outStringLength,out short outLengthNeeded);

Thanks,
Rob Panosh
 
R

Rob Panosh

Cor,

Thanks I will take a look.

Rob

Cor said:
Hi Rob,

When you look at this yesterday revised page, I think that you can do it
yourself

http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_comparison.html

Cor
Could somebody please assist me in converting the following C#.Net code to
VB.Net code?

[DllImport("odbc32.dll")]
private static extern short SQLAllocHandle(short hType, IntPtr inputHandle,
out IntPtr outputHandle);
[DllImport("odbc32.dll")]
private static extern short SQLSetEnvAttr(IntPtr henv, int attribute, IntPtr
valuePtr, int strLength);
[DllImport("odbc32.dll")]
private static extern short SQLFreeHandle(short hType, IntPtr handle);
[DllImport("odbc32.dll",CharSet=CharSet.Ansi)]
private static extern short SQLBrowseConnect(IntPtr hconn, StringBuilder
inString, short inStringLength, StringBuilder outString, short
outStringLength,out short outLengthNeeded);
 
R

Rob Panosh

Cor,

Can't find the VB equiv for C# ... IntPtr inputHandle

Any Ideas?

Rob


Cor said:
Hi Rob,

When you look at this yesterday revised page, I think that you can do it
yourself

http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_comparison.html

Cor
Could somebody please assist me in converting the following C#.Net code to
VB.Net code?

[DllImport("odbc32.dll")]
private static extern short SQLAllocHandle(short hType, IntPtr inputHandle,
out IntPtr outputHandle);
[DllImport("odbc32.dll")]
private static extern short SQLSetEnvAttr(IntPtr henv, int attribute, IntPtr
valuePtr, int strLength);
[DllImport("odbc32.dll")]
private static extern short SQLFreeHandle(short hType, IntPtr handle);
[DllImport("odbc32.dll",CharSet=CharSet.Ansi)]
private static extern short SQLBrowseConnect(IntPtr hconn, StringBuilder
inString, short inStringLength, StringBuilder outString, short
outStringLength,out short outLengthNeeded);
 
J

Jay B. Harlow [MVP - Outlook]

Rob,
IntPtr is System.IntPtr, you use it the same way in VB.NET that you do in
C#.

http://msdn.microsoft.com/library/d...us/cpref/html/frlrfSystemIntPtrClassTopic.asp

It is the correct type to use here.

Hope this helps
Jay

Rob Panosh said:
Cor,

Can't find the VB equiv for C# ... IntPtr inputHandle

Any Ideas?

Rob


Cor said:
Hi Rob,

When you look at this yesterday revised page, I think that you can do it
yourself

http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_comparison.html

Cor
code
to
VB.Net code?

[DllImport("odbc32.dll")]
private static extern short SQLAllocHandle(short hType, IntPtr inputHandle,
out IntPtr outputHandle);
[DllImport("odbc32.dll")]
private static extern short SQLSetEnvAttr(IntPtr henv, int attribute, IntPtr
valuePtr, int strLength);
[DllImport("odbc32.dll")]
private static extern short SQLFreeHandle(short hType, IntPtr handle);
[DllImport("odbc32.dll",CharSet=CharSet.Ansi)]
private static extern short SQLBrowseConnect(IntPtr hconn, StringBuilder
inString, short inStringLength, StringBuilder outString, short
outStringLength,out short outLengthNeeded);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top