Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2004, 08:57 PM
Kep Kep is offline
Authorized User
 
Join Date: Aug 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default OLEDB Connection Dialog

Hi all,

is there a way to popup the OleDb connection dialog box using the .NET framework?

Thanks,

Kep.
__________________
Kep.
 
Old December 14th, 2004, 06:28 AM
Registered User
 
Join Date: Dec 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There's some code at http://blogs.msdn.com/shaykatc/archi...13/112601.aspx which I think does what you want. I found some minor typos in it, and my version is:

      MSDASC.DataLinks oDL = new MSDASC.DataLinksClass();
      ADODB.Connection conn = new ADODB.ConnectionClass();
      object oConn = (object) conn;
      if (oDL.PromptEdit(ref oConn))
        MessageBox.Show(conn.ConnectionString);

Chris Jobson

Chris Jobson
 
Old December 14th, 2004, 07:49 PM
Kep Kep is offline
Authorized User
 
Join Date: Aug 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Chris. Do you know where the assembly with the MSDASC namespace is. I've tried the link you gave but our firewall blocks it.

Do I need to import a type library from somewhere or has this already been done?

Kep.
 
Old December 15th, 2004, 05:24 AM
Registered User
 
Join Date: Dec 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry you can't see the link. You need to add two references to COM components:
- Microsoft ActiveX Data Objects 2.7 Library for the ADODB namespace;
- Microsoft OLE DB Service Component 1.0 Type Library for the MSDASC namespace.
Hope this helps.

Chris

Chris Jobson
 
Old December 15th, 2004, 06:10 PM
Kep Kep is offline
Authorized User
 
Join Date: Aug 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Works a treat, thanks Chris.

Kep.





Similar Threads
Thread Thread Starter Forum Replies Last Post
webpart using sonofsmartpart and OLedb Connection aymane SharePoint Development 0 June 20th, 2006 09:59 AM
Deploying CR 8.5 using (DSN less) OLEDB Connection ashu_from_india Crystal Reports 0 July 10th, 2005 09:23 AM
Deploying CR 8.5 using (DSN less) OLEDB Connection ashu_from_india Pro VB 6 0 June 29th, 2005 04:12 AM
OleDb Connection string bimal General .NET 1 January 3rd, 2005 03:02 PM
OLEDB connection string variation Edward Stephen Classic ASP Databases 4 November 2nd, 2004 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.