none
Using ADO.net provider in INDUSOFT SCADA RRS feed

  • Question

  • Hi there, I am currently doing an INDUSOFT scada application that record/log the total flow every hour and store in MsAccess database. For retrieving the data from the table that generated in the database,by using ADO.net provider, it can be done by using SQL statment, SELECT * From [tablename]. To filter out the data by selected period( which most of the clients demand in HMI function), the statment will be SELECT * From [tablename] Where [field in table]>= #DD1/MM1/yyyy1# and <=#DD2/MM2/yyyy2#...if im not wrong ><"..however the date is predefined by us....


    The problem now is, the application allowed user to select the date, how to make the selected date by user to update and display in #DD1/MM1/yyyy1# and #DD2/mm2/yyyy2# so that it only retrieve the data from the selected date which defined by user?
    In scada, I'd made a function that store the selected start and end date to 2 different tags.

    Thank You.

    From,
    YYM
     
    Thursday, February 12, 2009 2:17 AM

Answers

  • I am unfamilar with Scada, can you provide more information on this. Are you using DataSet here? This forum is specifically setup to deal with questions around Dataset.

    If you have a specific questions on how to create Sql Queries and use Ado.net Providers I would suggest in the future that you post to this forum
    http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/threads/

    Now if you are using a Sql Adapter, querying for results and filling them into a Dataset then you would likely want to review follow the following example.

    http://msdn.microsoft.com/en-us/library/33y2221y.aspx
    At the end of the article is code on how query a database using the Ado.net DataAdapter code, then fill it into a DataTable, make a change and update the data back to the database.

    Assuming that the DataTable is databound to a grid and you would want to create a new DataAdapter with a different select expression, then simply clear the results that are in the dataTable (dataTable.Clear), and Fill the dataTable again and repopulate the grid.


    Thanks
    Chris Robinson
    Program Manager- Dataset
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, February 13, 2009 4:46 PM

All replies

  • I am unfamilar with Scada, can you provide more information on this. Are you using DataSet here? This forum is specifically setup to deal with questions around Dataset.

    If you have a specific questions on how to create Sql Queries and use Ado.net Providers I would suggest in the future that you post to this forum
    http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/threads/

    Now if you are using a Sql Adapter, querying for results and filling them into a Dataset then you would likely want to review follow the following example.

    http://msdn.microsoft.com/en-us/library/33y2221y.aspx
    At the end of the article is code on how query a database using the Ado.net DataAdapter code, then fill it into a DataTable, make a change and update the data back to the database.

    Assuming that the DataTable is databound to a grid and you would want to create a new DataAdapter with a different select expression, then simply clear the results that are in the dataTable (dataTable.Clear), and Fill the dataTable again and repopulate the grid.


    Thanks
    Chris Robinson
    Program Manager- Dataset
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, February 13, 2009 4:46 PM
  • yea..i believe it is a dataset. I am using INDUSOFT scada. From this scada, it will auto-generates a table with 2 columns(time_stamp, value) in the database that i linked to the scada, moreover it will retrieve and update the data in table every second. My problem is the filter statment by time/date, normally it is "SELECT * FROM [tablename] WHERE time_stamp>=#MM/DD/YYYY#"

    This works fine, but the date is defined by us....In my application, I would like to make the end-user able selects the date, which means I wanna make #MM/DD/YYYY# to user input. Is it possible? I'd make a datetimepicker in scada which will store the date and time into microsoftdatetimepicker.value as string.....
    Monday, February 16, 2009 4:59 AM