/* $Id: SQLServerConnector.cs,v 1.5 2004/11/24 13:57:05 larsbm Exp $
* Copyright (c) 2004 Engine EAR GmbH & Co. KG
* Developed by: Lars Behrmann, lb@engine.de
*/
using System;
using System.Collections;
using System.Data;
using SQLToNeo.PlugIn;
namespace SQLToNeo.Model{
/// <summary>
/// Zusammenfassung fr SQLServerConnector.
/// </summary>
public class SQLServerConnector : IDatabaseConnector
{
private string _connectionNT = "data source=#source#;Integrated Security=SSPI";
private string _connectionUser = "data source=#source#;User Id=#user#;Password=#password#";
private string _connection;
public SQLServerConnector()
{}
#region IDatabaseConnector Member
public bool CreateConnectionString(string db, string user, string password, bool ntauthentication)
{
if(db.Length == 0)
return false;
if(ntauthentication)
{
_connectionNT = _connectionNT.Replace("#source#", db);
_connection = _connectionNT;
return true;
}
else
{
if(user.Length == 0 || password.Length == 0)
return false;
else
{
_connectionUser = _connectionUser.Replace("#source#", db);
_connectionUser = _connectionUser.Replace("#user#", user);
_connectionUser = _connectionUser.Replace("#password#", password);
_connection = _connectionUser;
return true;
}
}
}
public ArrayList GetExistingDatabaseNames()
{
// TODO: Implementierung von SQLServerConnector.GetExistingDatabaseNames hinzufgen
return null;
}
public string ConnectionString
{
get
{
return _connection;
}
set
{
_connection = value;
}
}
public bool NTAuthenticationPossible
{
get { return true; }
}
#endregion
}
}
/*
* $Log: SQLServerConnector.cs,v $
* Revision 1.5 2004/11/24 13:57:05 larsbm
* - new project SQLToNeoPlugIn
* - switched interfaces from mainsource into plug in
*
* Revision 1.4 2004/11/02 14:02:38 larsbm
* - Add new property to IDataBaseConnector
* - Form for displaying possible conflicts
* - Implement Conflictform
* - Add Mainmenu to mainform
*
* Revision 1.3 2004/10/20 14:03:31 larsbm
* - Added support for foreign and primary keys
* - Implement SQLServerConnector (half)
* - Running into trouble with merging datasets marked as todo
*
* Revision 1.2 2004/10/19 14:08:21 larsbm
* - Start fill IServerConnector methods/properties
*
*/
|