SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to generate a recordset with C#

    I am converting an application that connects to Quality Center via the OTA API from VB.net to C#. The application makes extensive use of recordsets, but I have not been able to get them to work in C#. Specifically, I have trouble casting Command and Recordset to the correct format for C#. Everything I have tried has failed.

    Following, is an VB.net example of the code that I need to convert.

    <font class="small">Code:</font><hr /><pre>

    Private Function GetRecSet(ByVal Qry As String, TD as TDConnection) As Recordset

    Dim Com As Command = TD.Command
    Com.CommandText = Qry

  2. #2
    Junior Member
    Join Date
    Oct 2009
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to generate a recordset with C#

    Part of my code got cut off. Here is the full function.

    Private Function GetRecSet(ByVal Qry As String, _
    TD as TDConnection) As Recordset
    Dim Com As Command = TD.Command
    Com.CommandText

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to generate a recordset with C#

    Last try:

    Private Function GetRecSet(ByVal Qry As String, TD as TDConnection) As Recordset

    Dim Com As Command = TD.Command
    Com.CommandText = Qry
    GetRecSet = Com.Execute
    GetRecSet.First()

    End Function

  4. #4
    Junior Member
    Join Date
    Oct 2009
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to generate a recordset with C#

    I was able to figure out an answer on my own. So here for posterity is my answer:

    <font class="small">Code:</font><hr /><pre>

    static TDAPIOLELib.Recordset GetRecSet(String Qry, TDAPIOLELib.TDConnection TD)
    {

    TDAPIOLELib.Command Com;
    Com = TD.Command as TDAPIOLELib.Command;
    Com.CommandText = Qry;

    TDAPIOLELib.Recordset RecSet = Com.Execute() as TDAPIOLELib.Recordset;
    return RecSet;

    }

    </pre><hr />

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:30 AM.

Copyright BetaSoft Inc.