C# and ADO (Not ADO.NET) recordset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All,

I am using C# and would like to create a ADO (NOT ADO.NET) disconnected
recordset. Is this possible and how would I go about it.

Thanks
Msuk
 
sounds like you need to read about DataSets and ADO.NET

use a DataAdapter to Fill() a DataSet, and go from there...
 
Hi,

If I was to go with a ADO.NET Dataset could I send it back to a COM VB6
component which would treat it like a ADO 2.8 Recordset object?

Thanks
Msuk
 
Hi,

This is fine, but if I want to append more fields onto the end of the
records c# keeps throwing an exception as it is not happy about optional
parameters. Even if I enter the correct types for the parameters it still
throws an exception stating one of the type or data is incorrect but the code
work fine in VB6

See if below:

using System;
using ADODB;

namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
ADODB.Recordset objRecordSet= new ADODB.Recordset();


objRecordSet.ActiveConnection = null;
objRecordSet.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
objRecordSet.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic;

objRecordSet.Fields.Append
("field1",ADODB.DataTypeEnum.adChar,10,ADODB.FieldAttributeEnum.adFldMayBeNull ,"test");
//objRecordSet.Open();



}
}
}
 
Back
Top