PC Review


Reply
Thread Tools Rate Thread

Admin Access to SQLConnection class

 
 
=?Utf-8?B?bWFyY21j?=
Guest
Posts: n/a
 
      8th Aug 2005
Hey All,

When I log in as admin, i want to be able to set the database properties
(UserName, Password, Database & Server) to be passed to the
SQLClient.SqlConnection class. I have been working with defaults during
development. Now if admin logs in I want to allow them to change the settings
so as they are held from then onwards. This alllows me no not have to change
any code when distributing this App.

So I start with 4 text boxes on my 2nd(Main Form) form - because thewy would
just look out of place on the login or Form3.

I am hard coding these but it's not dynamic and nor practical.
So currantly I set up a Module called dbProps and give it the values from
Form2 TextBoxes mentioned above. This then allows the values to be passed
around the 3 screens.

I toyed with the idea of using a table to hold the connection data but
worked out that I wouldn't be able to connect to it without the values in
that table!! Can I use a trusted connection r something?

The final result is that I do not want "sa", "blank", "DbName" & "SrvName"
to be hard-coded within the app. How do I get around this problem.

 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      8th Aug 2005
Hi,

http://msdn.microsoft.com/library/de...ingstorage.asp

Ken
--------------------------
"marcmc" <(E-Mail Removed)> wrote in message
news:77E2DB92-E5CE-433E-88AD-(E-Mail Removed)...
Hey All,

When I log in as admin, i want to be able to set the database properties
(UserName, Password, Database & Server) to be passed to the
SQLClient.SqlConnection class. I have been working with defaults during
development. Now if admin logs in I want to allow them to change the
settings
so as they are held from then onwards. This alllows me no not have to change
any code when distributing this App.

So I start with 4 text boxes on my 2nd(Main Form) form - because thewy would
just look out of place on the login or Form3.

I am hard coding these but it's not dynamic and nor practical.
So currantly I set up a Module called dbProps and give it the values from
Form2 TextBoxes mentioned above. This then allows the values to be passed
around the 3 screens.

I toyed with the idea of using a table to hold the connection data but
worked out that I wouldn't be able to connect to it without the values in
that table!! Can I use a trusted connection r something?

The final result is that I do not want "sa", "blank", "DbName" & "SrvName"
to be hard-coded within the app. How do I get around this problem.


 
Reply With Quote
 
=?Utf-8?B?bWFyY21j?=
Guest
Posts: n/a
 
      8th Aug 2005
thanks ken, i will use xml

"Ken Tucker [MVP]" wrote:

> Hi,
>
> http://msdn.microsoft.com/library/de...ingstorage.asp
>
> Ken
> --------------------------
> "marcmc" <(E-Mail Removed)> wrote in message
> news:77E2DB92-E5CE-433E-88AD-(E-Mail Removed)...
> Hey All,
>
> When I log in as admin, i want to be able to set the database properties
> (UserName, Password, Database & Server) to be passed to the
> SQLClient.SqlConnection class. I have been working with defaults during
> development. Now if admin logs in I want to allow them to change the
> settings
> so as they are held from then onwards. This alllows me no not have to change
> any code when distributing this App.
>
> So I start with 4 text boxes on my 2nd(Main Form) form - because thewy would
> just look out of place on the login or Form3.
>
> I am hard coding these but it's not dynamic and nor practical.
> So currantly I set up a Module called dbProps and give it the values from
> Form2 TextBoxes mentioned above. This then allows the values to be passed
> around the 3 screens.
>
> I toyed with the idea of using a table to hold the connection data but
> worked out that I wouldn't be able to connect to it without the values in
> that table!! Can I use a trusted connection r something?
>
> The final result is that I do not want "sa", "blank", "DbName" & "SrvName"
> to be hard-coded within the app. How do I get around this problem.
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SqlConnection.InfoMessage - SqlError.Class wrong value ? Stephen Ahn Microsoft ADO .NET 1 23rd Aug 2007 06:38 PM
Disposing a SqlConnection class resource CEO Gargantua Microsoft ADO .NET 3 20th Jan 2005 07:45 PM
How to build sqlConnection class in VB.NET for window applications Loi Tan Vo Microsoft VB .NET 1 4th Aug 2004 01:44 PM
Re: reference to a sqlConnection object fromone class to another. Ignacio Machin Microsoft C# .NET 0 8th Jul 2003 02:37 PM
Re: reference to a sqlConnection object fromone class to another. Nicholas Paldino [.NET/C# MVP] Microsoft C# .NET 0 8th Jul 2003 02:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:18 AM.