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

Asking for a ConnectionString

Hi guys,
I need a way to ask the user for a ConnectionString for the OleDbConnection
object.
I can see in Visual Studio, that in Server Explorer I can add a data
connection, and a dialog is prompted to let me select the OLEDB provider and
its parameters.
My application should (virtually) be able to connect to any OLEDB database
so, is it possible to use this dialog window in .NET?

If not, how do you usually make the user select the connection string?

TIA
Ciao
Francesco
Nov 15 '05 #1
1 1245
Add two COM library reference to your project:
Microsoft ActiveX Data Objects and Microsoft OLE DB Service Component
Type Library.
Then add the following code:
MSDASC.DataLinks objDataLink = new MSDASC.DataLinksClass();
ADODB.Connection cn = new ADODB.ConnectionClass();
object objCn = (object) cn;
objDataLink.PromptEdit(ref objCn);
Than you'll find in cn.ConnectionString the connection string.

"Francesco" <fr*******@togliquesto.compu-net.it> schrieb im Newsbeitrag
news:%2***************@tk2msftngp13.phx.gbl...
Hi guys,
I need a way to ask the user for a ConnectionString for the OleDbConnection object.
I can see in Visual Studio, that in Server Explorer I can add a data
connection, and a dialog is prompted to let me select the OLEDB provider and its parameters.
My application should (virtually) be able to connect to any OLEDB database
so, is it possible to use this dialog window in .NET?

If not, how do you usually make the user select the connection string?

TIA
Ciao
Francesco

Nov 15 '05 #2

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

Similar topics

4
by: Devante | last post by:
Hi, I am fairly new to ASP.NET and have been working on a web form that will allow a user to upload images to a database. I have found a sample web form that I have been trying to get working,...
2
by: oswald verlinden | last post by:
Hi all, i have a client with an old working app. in PowerBuilder for which i need to create new modules. The db is sqlanywhere 5.0.4 The db is configured in ODBC. Now, i don't seem to be able...
2
by: G. Dean Blake | last post by:
We currently distribute a web application to serveral servers for a customer. We have been putting the connection string in our web.config file under <appSettings> <add...
6
by: Tony | last post by:
Dear All, When I run an example program on the http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/data/datagrid1.src&file=VB\datagrid1.aspx&font=3 ...
4
by: Shapper | last post by:
Hello, I have this connectionString in a DataReader: Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\db.mdb" It's working fine. Now i...
10
by: Laura K | last post by:
Tried all kinds of things. I get the error. The ConnectionString property has not been initialized. Any help appreciated. ...
3
by: Jim Andersen | last post by:
Hi, I would appreciate if someone could explain this behaviour, and maybe offer a better solution. I have been working with the GridView control. And SqlDataSource. It works great if I do:...
3
by: Arpan | last post by:
I recently installed SQL Server 2005 (Management Studio Express) along with SQL Server 2005 Express (Configuration Manager) in my Win2K Pro m/c & use IIS 5.0 to run ASPX projects. I could add my...
5
by: Radu | last post by:
Hi. In a repeater I have as ItemTemplate the following, among others, and everything works great: <asp:SqlDataSource ID="LocationSqlDataSource" SelectCommand="SELECT blah-blah-blah"...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.