🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.comp.lang.csharp
Article #718

Cos jak Data Link ale w .NET

#718
From: Selvin
Date: Mon, 29 Mar 2004 15:35
36 lines
2043 bytes
ok doszukalem sie w dokumentacji ze mozna cos takiego

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q308426

no i zrobilem cos takiego:
MSDASC.DataLinksClass datalink = new MSDASC.DataLinksClass();
ADODB.ConnectionClass conn = new ADODB.ConnectionClass();
conn.ConnectionString = "Provider=SQLOLEDB.1;" + Global.ConnectionString;
object temp = conn;
bool ret = datalink.PromptEdit(ref temp);
if(ret)
{
string constr = conn.ConnectionString;
int i = constr.IndexOf("Provider=SQLOLEDB");
if(i < 0)
{
MessageBox.Show("Po��czenie do bazy mo�e by� zrealizoawne tylko za pomoc�
sterownika:\n" +
"\"Microsoft OLE DB Provider for SQL Server\"","B��d",
MessageBoxButtons.OK,MessageBoxIcon.Error);
}
else
{
Global.ConnectionString = constr;
}
}

ale ja korzystam z ADO.NET a dokladnie namespace System.Data.SqlClient i nie
chce zawijac jakies
(moze gdybym to robil za pomoca OleDbClient to bym sobie odpuscil)
COMowej biblioteki tylko po to zeby otworzyc formatke do ustalania
polaczenia z baza

czy da sie jakos wylistowac dostepne servery SQL w domenie ??
bo jesli chodzi pozniej o dostepne bazy to bajka (zapytanie SQL do master i
juz)
Technical Details
Message-ID: <c49fl4$add$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!nntp.idg.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!nntp.idg.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail
From: "Selvin" <selvin...@nospam_osadkowski.com.pl>
Newsgroups: alt.pl.comp.lang.csharp
Subject: Cos jak Data Link ale w .NET
Date: Mon, 29 Mar 2004 17:35:20 +0200
Organization: news.onet.pl
Lines: 38
Sender: selvin@poczta.onet.pl@217.97.163.91
Message-ID: <c49fl4$add$1@news.onet.pl>
NNTP-Posting-Host: 217.97.163.91
X-Trace: news.onet.pl 1080574436 10669 217.97.163.91 (29 Mar 2004 15:33:56 GMT)
X-Complaints-To: ab...@onet.pl
NNTP-Posting-Date: 29 Mar 2004 15:33:56 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit