C1 sample "FlexGridExplorer" and path to "NORTHWND.db"

Posted by: wknauf on 14 December 2022, 6:42 am EST

  • Posted 14 December 2022, 6:42 am EST

    It seems there is a difference to the path where this file is installed and the path where the samples search it.

    The installation writes it to “C:\Users\USERNAME\Documents\ComponentOne Samples\WinForms\v6.0\Common”.

    But the “FlexGridExplorer” sample uses a path built from:

    Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @“\ComponentOne Samples\Common”

    Here C1 version “v6.0” is missing.

    See also current source code: https://github.com/GrapeCity/ComponentOne-WinForms-Samples/blob/master/Core/FlexGrid/CS/FlexGridExplorer/Data/DataSource.cs

    Best regards

    Wolfgang

  • Posted 15 December 2022, 4:50 am EST

    Hi Wolfgang,

    When you install any ComponentOne control with samples, a ‘Common’ folder containing the DataBase named ‘NORTHWND.db’ is saved at the location: C:\Users<USERNAME>\Documents\ComponentOne Samples\Common

    The same database file(NORTHWND.db) is saved at location: “C:\Users<USERNAME>\Documents\ComponentOne Samples\WinForms\v6.0\Common” along with the C1 samples for particular tech(Winform, WPF, etc.).

    Since the database file is irrespective of the version of the controls used, the “FlexGridExplorer” sample uses the following path for accessing the database: Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @“\ComponentOne Samples\Common”

    In case, this file is not available in your system at the location specified above, you can try updating the path in the “FlexGridExplorer” sample to the following: Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @“\ComponentOne Samples\WinForms\v6.0\Common"

    This will fetch the database from the location: “C:\Users<USERNAME>\Documents\ComponentOne Samples\WinForms\v6.0\Common”

    Hope this helps!

    Thanks & regards,

    Aastha

  • Posted 15 December 2022, 7:10 am EST

    OK, might be related to a different installation. As I am no admin on my machine, I have to enter a different user when invoking the ComponentOne Control Panel. And here, the samples would be placed in the Documents of the admin user, which are not accessible by me.

    So, I choose the folder “C:\Users\Public\Documents”.

    And here, I don’t see the directory “C:\Users\Public\Documents\ComponentOne Samples\Common”.

    In the admin profile, there IS a “Common” directory, but from 2021.

    Maybe this is the reason? Is there a problem with the Common folder if I pick a different samples directory during installation? I cannot reproduce it now, as I would probably have to uninstall the C1 stuff first.

    Here is an older question of mine regarding this installation problem: https://www.grapecity.com/forums/winforms-edition/default-installation-path-for-samples

    Best regards

    Wolfgang

  • Posted 17 December 2022, 4:18 pm EST

    Hi Wolfgang,

    We understand that you want the ‘Common’ folder to be saved to a location you specify in the path when installing the ComponentOne sample since you do not have admin rights. Unfortunately, this cannot be done since the samples refer to the location: “C:\Users\USERNAME\Documents\ComponentOne Samples\Common” and hence the “Common” folder will not be saved elsewhere while installing the samples.

    In case you want to access the database from a different location, you have to modify the path that your sample application uses to fetch the data.

    Regarding your concern about the difference in the path where the “Common” file is installed and the path where the samples search it, we have raised a query to the developers asking them for the need for the “Common” folder at “C:\Users\USERNAME\Documents\ComponentOne Samples\WinForms\v6.0”. [Internal Tracking ID: C1WIN-28777]

    Thanks & Regards,

    Aastha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels