[DllImport("odbc32.dll")]
static extern short SQLGetData(IntPtr StatementHandle,
ushort ColumnNumber, short TargetType,
StringBuilder TargetValue, int BufferLength,
out int StrLen_or_Ind);
<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
//data-types
public const int SQL_C_CHAR = 1;
Do you know one? Please contribute it!
None.
Please add some!
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();
}