c# - Set Connection String of DataSet.xsd based on User Setting -
situation
i have c# program utilizes dataset.xsd displaying sales data in window. works connection string dataset.xsd uses hardcoded .accdb file , dynamic assignment.
problem
the specific file path of database can changed in user settings, leads path issue sales window. connection string being grabbed user setting in program.
question
the c:\fits\fits3sr\fits_7.accdb
segment path changed user. there way programitcally or dynamically change connection string?
i figured out workaround it. because connection string forced application setting, set read setting default , under impression not edited. fortunately, able change value of application setting @ runtime using following line:
properties.settings.default["settingname"] = "connection string goes here";
hope helps else.
Comments
Post a Comment