Click here to Skip to main content
15,902,636 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# xml serializer Pin
ppp00122-Aug-05 8:46
ppp00122-Aug-05 8:46 
GeneralRe: C# xml serializer Pin
Robert Rohde23-Aug-05 8:52
Robert Rohde23-Aug-05 8:52 
GeneralMMC Snap Ins Pin
Mridang Agarwalla22-Aug-05 7:44
Mridang Agarwalla22-Aug-05 7:44 
GeneralRe: MMC Snap Ins Pin
Robert Rohde22-Aug-05 8:37
Robert Rohde22-Aug-05 8:37 
GeneralAssembly Language and C# Pin
Mridang Agarwalla22-Aug-05 7:31
Mridang Agarwalla22-Aug-05 7:31 
GeneralRe: Assembly Language and C# Pin
Daniel Turini22-Aug-05 8:06
Daniel Turini22-Aug-05 8:06 
GeneralRe: Assembly Language and C# Pin
leppie22-Aug-05 23:56
leppie22-Aug-05 23:56 
GeneralODBC: SqlGetDiagRec - help needed Pin
Shahrazad22-Aug-05 7:31
sussShahrazad22-Aug-05 7:31 
Hi,

As a beginning C# programmer I have some trouble getting this ODBC function to work.

<br />
// the declaration:<br />
[DllImport("odbc32.dll",CharSet=CharSet.Ansi)]<br />
private static extern short SQLGetDiagRec( <br />
    short HandleType, <br />
    IntPtr inputHandle, <br />
    ushort RecNumber, <br />
    string SqlState, <br />
    short NativeError, <br />
    String MessageText, <br />
    short bufferLength, <br />
    short TextLength );<br />
<br />
<br />
<br />
//the call<br />
<br />
String messageText = string.Empty;<br />
short messageTextlen = 128;<br />
short nativeErr = 0;<br />
string sqlState = " ";<br />
short rc = SQLGetDiagRec(<br />
    SQL_HANDLE_ENV, <br />
    m_environmentHandle, <br />
    1, <br />
    sqlState, <br />
    nativeErr, <br />
    messageText, <br />
    messageTextlen, <br />
    128);<br />



Whatever I do, after all ODBC calls I make, sqlState will always show spaces and messagetext will always be an empty string

I guess I'm doing something wrong here, but can't begin to wonder what.
Is the declaration with DLLImport of this function not correct, is there something wrong with the parameters when the function is called ? Should I use pointers maybe (I thought in C# that was no longer necessary)

I hope some of the guru's can get me going on this Sigh | :sigh:

Thanks,
Shah Rose | [Rose]
GeneralRe: ODBC: SqlGetDiagRec - help needed Pin
Shahrazad22-Aug-05 23:40
sussShahrazad22-Aug-05 23:40 
GeneralWMI Pin
Mridang Agarwalla22-Aug-05 7:24
Mridang Agarwalla22-Aug-05 7:24 
GeneralRe: WMI Pin
Daniel Turini22-Aug-05 8:06
Daniel Turini22-Aug-05 8:06 
GeneralRe: WMI Pin
leppie23-Aug-05 0:03
leppie23-Aug-05 0:03 
GeneralManaged DirectX: load large Bitmap Pin
silka_c#22-Aug-05 7:09
silka_c#22-Aug-05 7:09 
GeneralRe: Managed DirectX: load large Bitmap Pin
Daniel Turini22-Aug-05 7:41
Daniel Turini22-Aug-05 7:41 
GeneralRe: Managed DirectX: load large Bitmap Pin
silka_c#22-Aug-05 22:39
silka_c#22-Aug-05 22:39 
GeneralRe: Managed DirectX: load large Bitmap Pin
Daniel Turini22-Aug-05 23:17
Daniel Turini22-Aug-05 23:17 
GeneralRe: Managed DirectX: load large Bitmap Pin
silka_c#22-Aug-05 23:43
silka_c#22-Aug-05 23:43 
GeneralRe: Managed DirectX: load large Bitmap Pin
Daniel Turini23-Aug-05 3:52
Daniel Turini23-Aug-05 3:52 
QuestionRe: Managed DirectX: load large Bitmap Pin
silka_c#29-Aug-05 5:24
silka_c#29-Aug-05 5:24 
GeneralDataGrid Row Highlight Pin
econner22-Aug-05 6:40
econner22-Aug-05 6:40 
GeneralRe: DataGrid Row Highlight Pin
Robert Rohde22-Aug-05 8:42
Robert Rohde22-Aug-05 8:42 
GeneralRe: DataGrid Row Highlight Pin
rudy.net22-Aug-05 17:45
rudy.net22-Aug-05 17:45 
GeneralDataGrid/Cells read only Pin
econner22-Aug-05 6:37
econner22-Aug-05 6:37 
GeneralCom+ Problem Pin
webhay22-Aug-05 6:33
webhay22-Aug-05 6:33 
Generalformatting text Pin
samoore22-Aug-05 6:07
samoore22-Aug-05 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.