none
Problems with BindingSource and ResulSet RRS feed

  • Question

  • Hi all,

    I have a problem developing with VS2008 with C#. I am developing a mobile application and I am using a BindingSource with a Data base created and joined to the Binding Source before complile, but my problem is that I need to give the option to the users to change the data base, In the program folder there are diferents data base, but to change the datasource of the BindingSouce , I can not use the addres of the data base, I need the ResultSet or DataSet (I am using ResultSet) of the database, how can I create a ResultSet of a new DataBase???

    Thanks. 

    Thursday, December 30, 2010 9:58 AM

Answers

  • You don't bind with that code your DataSource to a My Database, you bind your database to an Ienumerable or whatever for binding correct object to your datasource. 

    Your bindingsource is operating disconnected from your database.

    Because of the devoted way you wrote that I'm wrong in this, is it probably hard to help you.

     


    Success
    Cor
    Tuesday, January 4, 2011 6:36 AM

All replies

  • You do never bind by the bindingsource to a database, it is always to a datasource (which object has to implement an IEnumerable, IListSource or ITypedList). 

     


    Success
    Cor
    Thursday, December 30, 2010 11:21 AM
  • with

    this.bindingSource1.DataSource=SmartDeviceProject1.FilmsQuestions1ResultSets.QuestionsTableResultSet;

    I am binding my BindingSource to a My DataBase, this Data Base as you can see is a table of result set, it is working I am able to add new records, delete, search, etc, but my problem is when I need change this database (FilmsQuestions1.sdf), my questions was how can I do a new ResultSet of a new DataBase.

    Thanks.

    Thursday, December 30, 2010 12:10 PM
  • Hi Guardin,

    What framework class library are you using?
    Iif it is not .NET Framework  but .NET Compact Framework, I suggest that you close this thread and post your issue in a proper forum for better support:
    Smart Device Development Forums

    Sincerely,
    Leo Liu
     


    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 4, 2011 5:49 AM
    Moderator
  • You don't bind with that code your DataSource to a My Database, you bind your database to an Ienumerable or whatever for binding correct object to your datasource. 

    Your bindingsource is operating disconnected from your database.

    Because of the devoted way you wrote that I'm wrong in this, is it probably hard to help you.

     


    Success
    Cor
    Tuesday, January 4, 2011 6:36 AM