473,396 Members | 2,014 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,396 software developers and data experts.

Newbi 'how to' questions

I am a long time Delphi programmer.
I am starting to work with c#.
I have a couple of questions on how to define connection settings on the
fly, since I have many client sites, each with their own database setup
differently as far as name, server name etc. Pretty common.

My Delphi App uses components to retrieve avaliable server names and
available database names, then I wrote code to build the connection string.
I am trying to find either a way to call up the standard connection dialog
box, or to get the server names/database names from c#.
There is an overwhelming amount of help, but everywhere I've looked, the
connection is hardcoded in some way, or the user has to type in the
servername/database name with no selection from combo boxes.

Does anyone have an example of how to dynamically create the connection
string, or how to get the servername/database lists so I can create the
string myself?

Aug 15 '07 #1
4 1188
If you have or can create lists of servers and databases you can fill list
or combo boxes using basic samples for these controls from MSDN.

You can create connection string using string operations like +, Append and
others.

What exactly is causing you grief?
"Connie McBride" <co*****@nospamhigh5software.comwrote in message
news:eU**************@TK2MSFTNGP04.phx.gbl...
>I am a long time Delphi programmer.
I am starting to work with c#.
I have a couple of questions on how to define connection settings on the
fly, since I have many client sites, each with their own database setup
differently as far as name, server name etc. Pretty common.

My Delphi App uses components to retrieve avaliable server names and
available database names, then I wrote code to build the connection
string.
I am trying to find either a way to call up the standard connection dialog
box, or to get the server names/database names from c#.
There is an overwhelming amount of help, but everywhere I've looked, the
connection is hardcoded in some way, or the user has to type in the
servername/database name with no selection from combo boxes.

Does anyone have an example of how to dynamically create the connection
string, or how to get the servername/database lists so I can create the
string myself?

Aug 15 '07 #2
What exactly is causing you grief?
Getting the list of servers and databases. Is there a simple way of doing
that?

"AlexS" <sa***********@SPAMrogers.comPLEASEwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
If you have or can create lists of servers and databases you can fill list
or combo boxes using basic samples for these controls from MSDN.

You can create connection string using string operations like +, Append
and others.

What exactly is causing you grief?
"Connie McBride" <co*****@nospamhigh5software.comwrote in message
news:eU**************@TK2MSFTNGP04.phx.gbl...
>>I am a long time Delphi programmer.
I am starting to work with c#.
I have a couple of questions on how to define connection settings on the
fly, since I have many client sites, each with their own database setup
differently as far as name, server name etc. Pretty common.

My Delphi App uses components to retrieve avaliable server names and
available database names, then I wrote code to build the connection
string.
I am trying to find either a way to call up the standard connection
dialog box, or to get the server names/database names from c#.
There is an overwhelming amount of help, but everywhere I've looked, the
connection is hardcoded in some way, or the user has to type in the
servername/database name with no selection from combo boxes.

Does anyone have an example of how to dynamically create the connection
string, or how to get the servername/database lists so I can create the
string myself?


Aug 16 '07 #3
On Aug 15, 7:52 am, "Connie McBride" <conn...@nospamhigh5software.com>
wrote:
I am a long time Delphi programmer.
I am starting to work with c#.
I have a couple of questions on how to define connection settings on the
fly, since I have many client sites, each with their own database setup
differently as far as name, server name etc. Pretty common.

My Delphi App uses components to retrieve avaliable server names and
available database names, then I wrote code to build the connection string.
I am trying to find either a way to call up the standard connection dialog
box, or to get the server names/database names from c#.
There is an overwhelming amount of help, but everywhere I've looked, the
connection is hardcoded in some way, or the user has to type in the
servername/database name with no selection from combo boxes.

Does anyone have an example of how to dynamically create the connection
string, or how to get the servername/database lists so I can create the
string myself?

you can drop a file on the desktop,rename to "1.udl".
double click it and edit.

finally,open the file with notepad,you'll see the connectionString
there.
Aug 17 '07 #4

"Connie McBride" <co*****@nospamhigh5software.comwrote in message
news:eU**************@TK2MSFTNGP04.phx.gbl...
>I am a long time Delphi programmer.
I am starting to work with c#.
I have a couple of questions on how to define connection settings on the
fly, since I have many client sites, each with their own database setup
differently as far as name, server name etc. Pretty common.

My Delphi App uses components to retrieve avaliable server names and
available database names, then I wrote code to build the connection
string.
I am trying to find either a way to call up the standard connection dialog
box, or to get the server names/database names from c#.
There is an overwhelming amount of help, but everywhere I've looked, the
connection is hardcoded in some way, or the user has to type in the
servername/database name with no selection from combo boxes.

Does anyone have an example of how to dynamically create the connection
string, or how to get the servername/database lists so I can create the
string myself?
Searching for "enumerate data sources" or "enumerate ODBC data sources" gets
a lot of information.
Aug 17 '07 #5

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

Similar topics

3
by: mickey | last post by:
I am getting the following error at the line mysql_free_result($result); Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/php/phoneadd.php on line 27 My code...
2
by: Amadelle | last post by:
Hi all and thanks in advance, I have written a class library in C# (a set of cs classes) which I would like to install on our production webserver. It is used by some of the asp.net pages that...
44
by: MadCrazyNewbie | last post by:
Hey Group, I keep getting a error saying "No Value Given For One Or More Parameters". Unfortunatly I don`t know where this error is coming from:(. Can I run through my code line by line, so I...
1
by: daBearIsIn | last post by:
I am trying to work thru the book “Sams Teach Yourself CGI” and am having trouble running the first sample script. +++++++++++++++++++++++++++ #!C:\ProgramFiles\Perl\bin\perl use CGI; ...
2
by: krishnakant Mane | last post by:
hello, I am a new member to this list. I am Krishnakant from India, Mumbai. I have been coding in python for quite some time and now I am at the intermediate level of programming as far as python...
3
by: krishnakant Mane | last post by:
hello, searched a lot of places including google search but can't find answers to python-rpc. I am also very new to rpc. I am very clear about its meaning and where it is to be used, but not...
3
by: Strasser | last post by:
In a nested subform in datasheet view, an interviewer of homeless people picks a descriptive CATEGORY from 20 descriptive categories. The 20 categories are displayed via a combo box. (Categories...
1
by: 6655326 | last post by:
Newbi needs a very small help, thank you very much. Hello everyone and thank you very much for your time. I Have a small db for invoicing and on my form (with a subform) there is a CANCEL...
3
by: pdcjlw1 | last post by:
Hey I'm trying to learn how to connect a database to a C# project. The tutorial I am trying to follow says to do the following: Creating a Database Connection The first thing you need when...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.