The graph itself does not have built in support for grabbing data from
an access db. But you can use several of the .NET data access classes
to grab that data and plot it for you. This example just pulls a column
of doubles from an access db using ODBC. This might be a more complex operation
for you depending on how your db and data is organized.
[C#]
//create a connection to the access db using ODBC
using(OdbcConnection connection = new
OdbcConnection(@"DSN=mysource;DriverId=25;DBQ=C:\db1.mdb;FIL=MS
Access;UID=admin"))
{
using(OdbcCommand command = new OdbcCommand())
{
//open a connection
connection.Open();
command.Connection = connection;
//do some query
command.CommandText = "SELECT Field1 FROM Table2";
using(OdbcDataReader reader = command.ExecuteReader())
{
// grab the data returned and
populate a double array
ArrayList array= new ArrayList();
while(reader.Read())
{
array.Add(reader.GetDouble(0));
}
double[] data = (double[])array.ToArray(typeof(double));
//plot the
double array
waveformGraph2.PlotY(data);
}
}
}
I hope this helps
Bilal Durrani
NI