Datasets (DS) and DataTables (DT) in .NET

Question was asked:

When I’m using a recordset in VB6, I can use either of the following:



Do both of those work in .NET?



You don’t read the Dataset value directly

You put the dataset into a datatable and then you can reference it.

Like the following: PlanIdSearchComboBoxDT.Rows(i).Item("PlanID")


ReportMobiusDS = NADPMobiusReportDA.GetReportMobiusDataSet(currentError, _NADPMobiusReportDetail, StoredProcedureName)

ReportMobiusDS = NADPMobiusReportDA.GetReportMobiusDataSet(currentError, _NADPMobiusReportDetail, StoredProcedureName)

If Not currentError.Severity = FBError.ErrorSeverity.NoErrors Then MessageBox.Show(currentError.FriendlyError)



‘We then insert the report dataset in a data table in order to preserve formatting

dt = ReportMobiusDS.Tables(0)

‘NOTE: Tables are returned select statements.  The first return is indexed 0.  If you have multiple selects returning from a stored procedure you can call it by the zero based index of the table. 

Dim row As DataRow

For Each row In dt.Rows

If row("strLineToPrint").ToString <> "" Then s.WriteLine(CStr(row("strLineToPrint")).ToUpper)


…continue code…


Tags: , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: