VB.Net Database RRS feed

  • Question

  • Hi all,
    Need a bit of help, I'm currently using VS.Net 2008, and linked my form to a database (Database1.sdf) using the wizard,
    But I want to create a database for each month as time goes by, that the  filename would be like for example be "database82009.sdf"
    If the program starts, it should ask which database you want to use and link the selected database to use in the form.
    The creating of the databases I can do myself, but I need to set the (I think connectionstring / Dataset / Tableadapter ) to the other database file.

    Help will be appreciated.
    Tuesday, August 25, 2009 8:12 AM


All replies

  • Hi Wetrock,


    Do you encounter the problem of the storage of former connections?

    According to the structure of connection string for SQL CE, you can simply generate it by code.

    For the storage, you can use ConfigurationManger to manipulate AppSettings element to achieve it.


    Does this works for you? If you have any questions or concerns, please update the thread and we will have a further discussion.



    Best Regards

    Yichun Feng

    Thursday, August 27, 2009 6:34 AM
  • Nope not really,
    In short, it uses now database1.sdf, I need to be able to select which databse to use in the form, then add,edit/delete data in that database using textboxes.
    I should basically have a database for each month that the program is used, the tables will stay the same in all databases.
    Basically a listbox with all the available databases, the selected database must be used in the rest of the program!
    Hope you understand now?
    Thursday, August 27, 2009 11:03 AM
  • Kind of a long forum thread but you may want to check it out to see if there is a solution for you:
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Wetrock Friday, August 28, 2009 7:08 AM
    Thursday, August 27, 2009 1:47 PM
  • Thanks, that was basically exactly what I'm looking for!
    Don't know how I missed that forum!
    Thanks!! :-)
    Friday, August 28, 2009 7:09 AM