Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than odbc32, prefix the name with the module name and a period.
SQLGetData (odbc32)
.
C# Signature:
[DllImport("odbc32.dll")]
static extern short SQLGetData(IntPtr StatementHandle,
ushort ColumnNumber, short TargetType,
StringBuilder TargetValue, int BufferLength,
out int StrLen_or_Ind);
VB Signature:
<Runtime.InteropServices.DllImport("odbc32.dll")> _
Private Shared Function SQLGetData(ByVal statementHandle As IntPtr, ByVal columnNumber As UShort, _
ByVal targetType As Short, ByVal targetValue As IntPtr, ByVal bufferLength As Integer, _
ByRef strLen_or_Ind As Integer) As Short
End Function
TODO
User-Defined Types:
//data-types
public const int SQL_C_CHAR = 1;
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
string GetFieldValue(ushort colid)
{
StringBuilder val = new StringBuilder(1024);
int size;
short rc = SQLGetData(statementHandle, colid, SQL_C_CHAR, val, val.Capacity, out size);
if(rc!=0)
{
string err = GetError();
throw new Exception(err);
}
return val.ToString();
}
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).