Jump to content
Software FX Community

Dataset versus OpenData


User (Legacy)

Recommended Posts

It appears as if data can be loaded from either a dataset or through the

OpenData command. I basically have a text file that I want to read the

information in and plot.

Right now I havent found a very graceful way of reading a text file into a

dataset, but manually reading the file and passing the info through OpenData

seems like it may be easier.

Is there anything I am missing in regards to OpenData?

Amy.

Link to comment
Share on other sites

It appears as if data can be loaded from either a dataset or through the

OpenData command. I basically have a text file that I want to read the

information in and plot.

Right now I havent found a very graceful way of reading a text file into a

dataset, but manually reading the file and passing the info through OpenData

seems like it may be easier.

Is there anything I am missing in regards to OpenData?

Amy.

Link to comment
Share on other sites

  • 1 month later...

I populated manually from a datatable because I needed that level of

control. Here is the function I used. I begin at column 1 because column 0

is a row header. I am reading in values column by column, not row by row.

The function accepts a DataTable parameter. I deal with smaller tables and

this works great.

Mike

----------------------------------------------------------------------------

------------------------------------

Function AddDataPoints(ByVal cht As Chart, ByVal dtb As DataTable) As

Boolean

' data points are 0 based

' they are read COLUMN BY COLUMN, starting with column 1

Dim intSeries As Integer

Dim intCol As Integer

Dim dblValue As Double

Dim bRetVal as Boolean

Try

intColumns = dtb.Columns.Count - 1

intRows = dtb.Rows.Count

' loop and add 1 series at a time

cht.OpenData(COD.Values, intRows, intColumns)

For intSeries = 0 To intRows - 1

For intCol = 1 To intColumns

dblValue = dtb.Rows(intSeries).Item(intCol)

cht.Value(intSeries, intCol - 1) = dblValue

Next intCol

Next intSeries

cht.CloseData(COD.Values)

bRetVal = True

Catch ex As Exception

MsgBox(ex.Message)

bRetVal = False

Finally

AddDataPoints = bRetVal

End Try

End Function

"Amy L." <amyl@paxemail.com> wrote in message

news:a3G$y3QVCHA.1412@webserver1.softwarefx.com...

> It appears as if data can be loaded from either a dataset or through the

> OpenData command. I basically have a text file that I want to read the

> information in and plot.

>

> Right now I havent found a very graceful way of reading a text file into a

> dataset, but manually reading the file and passing the info through

OpenData

> seems like it may be easier.

>

> Is there anything I am missing in regards to OpenData?

>

> Amy.

>

>

Link to comment
Share on other sites

I populated manually from a datatable because I needed that level of

control. Here is the function I used. I begin at column 1 because column 0

is a row header. I am reading in values column by column, not row by row.

The function accepts a DataTable parameter. I deal with smaller tables and

this works great.

Mike

----------------------------------------------------------------------------

------------------------------------

Function AddDataPoints(ByVal cht As Chart, ByVal dtb As DataTable) As

Boolean

' data points are 0 based

' they are read COLUMN BY COLUMN, starting with column 1

Dim intSeries As Integer

Dim intCol As Integer

Dim dblValue As Double

Dim bRetVal as Boolean

Try

intColumns = dtb.Columns.Count - 1

intRows = dtb.Rows.Count

' loop and add 1 series at a time

cht.OpenData(COD.Values, intRows, intColumns)

For intSeries = 0 To intRows - 1

For intCol = 1 To intColumns

dblValue = dtb.Rows(intSeries).Item(intCol)

cht.Value(intSeries, intCol - 1) = dblValue

Next intCol

Next intSeries

cht.CloseData(COD.Values)

bRetVal = True

Catch ex As Exception

MsgBox(ex.Message)

bRetVal = False

Finally

AddDataPoints = bRetVal

End Try

End Function

"Amy L." <amyl@paxemail.com> wrote in message

news:a3G$y3QVCHA.1412@webserver1.softwarefx.com...

> It appears as if data can be loaded from either a dataset or through the

> OpenData command. I basically have a text file that I want to read the

> information in and plot.

>

> Right now I havent found a very graceful way of reading a text file into a

> dataset, but manually reading the file and passing the info through

OpenData

> seems like it may be easier.

>

> Is there anything I am missing in regards to OpenData?

>

> Amy.

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...