473,395 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Admin Access to SQLConnection class

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.

Nov 21 '05 #1
2 958
Hi,

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

Ken
--------------------------
"marcmc" <ma****@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
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.
Nov 21 '05 #2
thanks ken, i will use xml

"Ken Tucker [MVP]" wrote:
Hi,

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

Ken
--------------------------
"marcmc" <ma****@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
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.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jamesa | last post by:
I am a beginner and trying my first C# application. Any reason why I am getting the message Login failed for user 'admin' I have thoroughly checked the security settings in the sql server. Find...
5
by: Alex | last post by:
Hi, I have an aspx file that creates a custom class object and calls a method which should return a DataSet. It throws a: Description: The application attempted to perform an operation not...
4
by: Heath Kelly | last post by:
I need advice on correct usage of ADO.NET in an ASP.Net environment. I have an ASP.Net application that accesses data through a referenced class library. Things start to break down when multiple...
6
by: SteveS | last post by:
Hello All. I have an asp.net application with 3 different assemblies. They are like this: 1) Assembly: PublicSite (This contains the website UI) Root namespace: PublicSite 2) Assembly:...
0
by: Anton Sokolovsky | last post by:
Hello All, Please help. I am completely stuck. Any suggestions are very welcomed. I have ASP.NET application that impersonates certain user <impersonate="true" userName="registry:..."...
2
by: Michael Carr | last post by:
I recently discovered the "using" C# keyword and the neat and tidy way it guarantees cleanup of resources. However, how far should I take this? I recall some discussion from Microsoft suggesting...
7
by: =?Utf-8?B?Um9nZWxpbw==?= | last post by:
hey, I have 2 threads, th and th2, both of them run a method. each of these 2 methods requires database access. sometimes I get an error, that database requires an open connection, and that...
3
by: Michael Schöller | last post by:
Hello, First of all english is not my natural language so please fogive me some bad mistakes in gramatic and use of some vocables :). I have a great problem here. Well I will not use it...
13
by: tommymo | last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.