欢迎来到我的地盘:今天是

若得山花插满头,莫问奴归处!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

   Guid dataLinksGuid = new Guid("2206cdb2-19c1-11d1-89e0-00c04fd7a829");
   Type dataLinksType = Type.GetTypeFromCLSID(dataLinksGuid, true);
   object dataLinks = Activator.CreateInstance(dataLinksType);
   object connection = dataLinksType.InvokeMember("PromptNew", BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, dataLinks, new object[] {}, null);
   if(connection == null) return string.Empty;
   Guid connetionGuid = new Guid("00000550-0000-0010-8000-00AA006D2EA4");
   Type connectionType = Type.GetTypeFromCLSID(connetionGuid, true);
   return connectionType.InvokeMember("ConnectionString", BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, connection, new object[] {}, null) as string;


会弹出数据连接对话框。最后返回连接字符串。

posted on 2008-01-31 14:04  莫问奴归处  阅读(329)  评论(0编辑  收藏  举报
轩轩娃