PeterForstmeier 14 years ago
parent
commit
7a340184f8
  1. 22
      src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Windows/ConnectionWizardWindow.xaml.cs
  2. 5
      src/AddIns/DisplayBindings/Data/ICSharpCode.Data.SQLServer/SQLServerDatabaseDriver.cs

22
src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Windows/ConnectionWizardWindow.xaml.cs

@ -8,6 +8,7 @@ using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using ICSharpCode.Core;
using ICSharpCode.Data.Core.Interfaces; using ICSharpCode.Data.Core.Interfaces;
using System; using System;
using System.Threading; using System.Threading;
@ -115,11 +116,21 @@ namespace ICSharpCode.Data.Core.UI.Windows
Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { IsLoading = value; })); Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { IsLoading = value; }));
} }
// private void SetException(Exception exception)
// {
// Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { DatasourceException = exception; }));
// }
private void SetException(Exception exception) private void SetException(Exception exception)
{ {
Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { DatasourceException = exception; })); if (exception!= null) {
Dispatcher.BeginInvoke(DispatcherPriority.Background,
new Action(() => {MessageService.ShowError(exception.Message);}));
}
} }
private void SetSelectedDatasource(IDatasource datasource) private void SetSelectedDatasource(IDatasource datasource)
{ {
Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { SelectedDatasource = datasource; })); Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { SelectedDatasource = datasource; }));
@ -163,7 +174,8 @@ namespace ICSharpCode.Data.Core.UI.Windows
try try
{ {
SelectedDatabaseDriver.PopulateDatabases(); // SelectedDatabaseDriver.PopulateDatabases();
SelectedDatabaseDriver.PopulateDatabases(_selectedDatasource);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -235,13 +247,13 @@ namespace ICSharpCode.Data.Core.UI.Windows
#region INotifyPropertyChanged #region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged; public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string property) protected void OnPropertyChanged(string property)
{ {
if (PropertyChanged != null) if (PropertyChanged != null)
{ {
PropertyChanged(this, new PropertyChangedEventArgs(property)); PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(property));
} }
} }

5
src/AddIns/DisplayBindings/Data/ICSharpCode.Data.SQLServer/SQLServerDatabaseDriver.cs

@ -29,6 +29,9 @@ namespace ICSharpCode.Data.Core.DatabaseDrivers.SQLServer
private const string _getTables = @"SELECT TABLE_SCHEMA, TABLE_NAME from INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME<>'dtproperties' ORDER BY TABLE_SCHEMA, TABLE_NAME"; private const string _getTables = @"SELECT TABLE_SCHEMA, TABLE_NAME from INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME<>'dtproperties' ORDER BY TABLE_SCHEMA, TABLE_NAME";
//http://community.sharpdevelop.net/forums/p/12955/37213.aspx#37213
//clmns.is_column_set AS [IsColumnSet],
private const string _getColumnsScript = @"DECLARE @tablename varchar(100) SET @tablename = N'{0}' private const string _getColumnsScript = @"DECLARE @tablename varchar(100) SET @tablename = N'{0}'
SELECT SELECT
clmns.column_id AS [ColumnId], clmns.column_id AS [ColumnId],
@ -40,7 +43,7 @@ namespace ICSharpCode.Data.Core.DatabaseDrivers.SQLServer
CAST(clmns.precision AS int) AS [NumericPrecision], CAST(clmns.precision AS int) AS [NumericPrecision],
clmns.default_object_id AS [DefaultObjectId], clmns.default_object_id AS [DefaultObjectId],
clmns.is_ansi_padded AS [IsAnsiPadded], clmns.is_ansi_padded AS [IsAnsiPadded],
clmns.is_column_set AS [IsColumnSet],
clmns.is_computed AS [IsComputed], clmns.is_computed AS [IsComputed],
clmns.is_dts_replicated AS [IsDtsReplicated], clmns.is_dts_replicated AS [IsDtsReplicated],
clmns.is_filestream AS [IsFileStream], clmns.is_filestream AS [IsFileStream],

Loading…
Cancel
Save