c# - Typed DataSet connection - required to have one in the .xsd file? -


in .xsd file typed dataset in .net, there's <connections> section contains list of data connections i've used set datatables , tableadapters.

there times when i'd prefer not have there. instance, prefer pass in connection string custom constructor , use rather 1 in settings, .config, etc.

but seems if remove connection strings section (leaving empty), or remove section entirely, dataset code-generation tool freaks out. whereas if don't remove them, dataset gripes when put in different project because can't find settings connection strings.

is there way can tell typed dataset not worry connections? (obviously i'll have give connection if change tableadapter sql or stored procs, should my problem.)

this has bugged me long time , did testing recently. here came with. record, i'm using vs 2008 sp1.

  • datasets will store connection string information whether want them or not.
  • you can make sure datasets won't store passwords in connection strings.
  • you can either have connection string stored in 'connections' section .xsd file or can have stored in app.config file , referenced 'connections' section of .xsd file. either way, 'connections' section appears requirement.

if find way make work, please post here. currently, store connection string in xsd file , make sure i'm not storing password. then, when use it code, create own connection , never use 1 stored in dataset.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -