We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
' Full path to the data source file Dim file As String = "Top5.csv" ' Create a connection string. Dim ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "C:/gatewaydata/" + ";Extended Properties=""Text;HDR=No;FMT=Delimited""" Dim myConnection As New OleDbConnection(ConStr) ' Create a database command on the connection using query Dim mySelectQuery As String = "Select * from " + file Dim myCommand As New OleDbCommand(mySelectQuery, myConnection) ' Open the connection and create the reader myCommand.Connection.Open() Dim myReader As OleDbDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection) ' databind the reader to the chart using the DataBindXY method Chart1.Series(0).Points.DataBindXY(myReader, 1, myReader, 2) Chart1.Series(1).Points.DataBindXY(myReader, 1, myReader, 3) ' Close connection and data reader myReader.Close() myConnection.Close()