J
John Heitmuller.
I’m using VisualStudio 2008. My original problem is that I need to
change the database user login name in my application connection
string at runtime. I have to maintain an audit able of user actions
on the database, so I need to know who is running the application.
My thought was in the form_load() I would read the application
ConenctionString. Replace the generic DB login name with the user’s
login name. I would then loop through each of the strongly typed
TableAdapters and replace the TableAdapter’s connection string with
the new connection string with the user name.
It does not look like I can “foreach” my way through this. The only
way I can see to make this work right now is the hardcode a reference
to each TableAdapter by name and set its connection string.
Does anybody have any ideas for a better solution? I feel like I'm
missing something and over complicating this.
Thanks,
John
change the database user login name in my application connection
string at runtime. I have to maintain an audit able of user actions
on the database, so I need to know who is running the application.
My thought was in the form_load() I would read the application
ConenctionString. Replace the generic DB login name with the user’s
login name. I would then loop through each of the strongly typed
TableAdapters and replace the TableAdapter’s connection string with
the new connection string with the user name.
It does not look like I can “foreach” my way through this. The only
way I can see to make this work right now is the hardcode a reference
to each TableAdapter by name and set its connection string.
Does anybody have any ideas for a better solution? I feel like I'm
missing something and over complicating this.
Thanks,
John