🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.pl.comp.lang.csharp
2 messages
2 total messages Started by Selvin Mon, 29 Mar 2004 15:35
Cos jak Data Link ale w .NET
#718
Author: 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)
Re: Cos jak Data Link ale w .NET
#719
Author: Selvin
Date: Mon, 29 Mar 2004 15:36
6 lines
975 bytes
<ciach>
(to z pospiechu zapomnialem :P)

pozdrawiam

Przemek Sulikowski
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads