[Mono-list] Patch for sqlsharpgtk
Daniel Morgan
danielmorgan@verizon.net
Thu, 21 Oct 2004 01:58:17 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_002A_01C4B711.71BE7210
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_002B_01C4B711.71BE7210"
------=_NextPart_001_002B_01C4B711.71BE7210
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hello,
Can someone apply this patch in mono cvs module sqlsharpgtk please?
Thanks,
Daniel
------=_NextPart_001_002B_01C4B711.71BE7210
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hello,</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Can someone apply this patch in mono cvs module =
sqlsharpgtk
please?</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thanks,</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Daniel</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
</div>
</body>
</html>
------=_NextPart_001_002B_01C4B711.71BE7210--
------=_NextPart_000_002A_01C4B711.71BE7210
Content-Type: application/octet-stream;
name="diff.out"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="diff.out"
? diff.out=0A=
Index: ChangeLog=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/sqlsharpgtk/sqlsharpgtk/ChangeLog,v=0A=
retrieving revision 1.5=0A=
diff -u -r1.5 ChangeLog=0A=
--- ChangeLog 8 Jun 2004 23:15:17 -0000 1.5=0A=
+++ ChangeLog 21 Oct 2004 05:54:08 -0000=0A=
@@ -1,3 +1,25 @@=0A=
+2004-10-21 Daniel Morgan <danielmorgan@verizon.net>=0A=
+=0A=
+ * DataGrid.cs: added method DataLoad for loading the DataGrid from a =
IDataReader=0A=
+=0A=
+ * DbProvider.cs =0A=
+ * DbProviderCollection.cs: handle internal and external assemblies =
better=0A=
+ =0A=
+ * Makefile: use a target of winexe=0A=
+ =0A=
+ * sqlsharpgtk.cs: =0A=
+ - get external providers to work with Mono's GAC by providing =0A=
+ their fully qualified name when loading the assembly=0A=
+ - remove obsolete providers =0A=
+ (Mono.Data.MySql and Mono.Data.PostgreSqlClient and =
Mono.Data.DB2Client)=0A=
+ from provider collection.=0A=
+ - added data provider FirebirdSql.Data.Firebird to =0A=
+ provider collection. =0A=
+ - Comment unused menus. =0A=
+ - Load the grid from data reader instead of a data table=0A=
+ - treat ODBC as an external data provider=0A=
+ - remove debug code=0A=
+=0A=
2004-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>=0A=
=0A=
* Makefile: use the -pkg option. Patch from Eric Gonia.=0A=
Index: DataGrid.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/sqlsharpgtk/sqlsharpgtk/DataGrid.cs,v=0A=
retrieving revision 1.3=0A=
diff -u -r1.3 DataGrid.cs=0A=
--- DataGrid.cs 27 Mar 2004 23:16:51 -0000 1.3=0A=
+++ DataGrid.cs 21 Oct 2004 05:54:09 -0000=0A=
@@ -17,6 +17,7 @@=0A=
namespace Gtk.Controls =0A=
{=0A=
using System;=0A=
+ using System.Data;=0A=
using System.Collections;=0A=
using System.ComponentModel;=0A=
using System.Drawing;=0A=
@@ -71,12 +72,6 @@=0A=
sw.Add (treeView);=0A=
}=0A=
=0A=
- // FIXME: need to place in a base class=0A=
- // the DataSource, DataMember, DataBind()=0A=
- // public members.=0A=
- // maybe we can call the base class=0A=
- // BaseDataList for GTK#?=0A=
-=0A=
private object dataSource =3D null;=0A=
=0A=
private string dataMember =3D "";=0A=
@@ -99,6 +94,46 @@=0A=
}=0A=
}=0A=
=0A=
+ // alternative to DataBind()=0A=
+ public void DataLoad (IDataReader reader)=0A=
+ {=0A=
+ Clear ();=0A=
+ dataMember =3D "";=0A=
+ dataSource =3D null;=0A=
+ =0A=
+ GLib.GType[] theTypes =3D new GLib.GType[reader.FieldCount];=0A=
+ int col =3D 0;=0A=
+ for (col =3D 0; col < reader.FieldCount; col++)=20
+ {=0A=
+ theTypes[col] =3D GLib.GType.String;=0A=
+ }=0A=
+ store.SetColumnTypes (theTypes);=0A=
+=0A=
+ gridColumns =3D new DataGridColumn[reader.FieldCount];=0A=
+ IDataRecord record =3D (IDataRecord) reader;=0A=
+ for (col =3D 0; col < reader.FieldCount; col ++)=0A=
+ {=0A=
+ gridColumns[col] =3D new DataGridColumn ();=0A=
+ gridColumns[col].ColumnName =3D record.GetName(col);=0A=
+ }=0A=
+=0A=
+ TreeIter iter =3D new TreeIter ();=0A=
+ while (reader.Read ())=0A=
+ { =0A=
+ iter =3D NewRow ();=0A=
+ for (int c =3D 0; c < reader.FieldCount; c ++)
+ {=0A=
+ object oValue =3D reader[c];=0A=
+ string sValue =3D oValue.ToString ();=0A=
+ =0A=
+ SetColumnValue (iter, c, sValue);=0A=
+ }=0A=
+ }=0A=
+=0A=
+ treeView.Model =3D store;=0A=
+ AutoCreateTreeViewColumns (treeView);=0A=
+ }=0A=
+=0A=
public void DataBind () =0A=
{=0A=
Clear ();=0A=
@@ -107,16 +142,11 @@=0A=
o =3D GetResolvedDataSource (DataSource, DataMember);=0A=
IEnumerable ie =3D (IEnumerable) o;=0A=
ITypedList tlist =3D (ITypedList) o;=0A=
-=0A=
- // FIXME: does not belong in this base method=0A=
TreeIter iter =3D new TreeIter ();=0A=
=0A=
PropertyDescriptorCollection pdc =3D tlist.GetItemProperties (new =
PropertyDescriptor[0]);=0A=
-=0A=
- // FIXME: does not belong in this base method=0A=
gridColumns =3D new DataGridColumn[pdc.Count];=0A=
=0A=
- // FIXME: does not belong in base method=0A=
// define the columns in the treeview store=0A=
// based on the schema of the result=0A=
GLib.GType[] theTypes =3D new GLib.GType[pdc.Count];=0A=
@@ -125,7 +155,6 @@=0A=
}=0A=
store.SetColumnTypes (theTypes);=0A=
=0A=
- // FIXME: does not belong in this base method=0A=
int colndx =3D -1;=0A=
foreach (PropertyDescriptor pd in pdc) {=0A=
colndx ++;=0A=
@@ -143,15 +172,13 @@=0A=
foreach (PropertyDescriptor property in properties) {=0A=
object oPropValue =3D property.GetValue (obj);=0A=
string sPropValue =3D oPropValue.ToString ();=0A=
- =0A=
- // FIXME: does not belong in this base method=0A=
+ =0A=
SetColumnValue (iter, cv, sPropValue);=0A=
=0A=
cv++;=0A=
}=0A=
}=0A=
=0A=
- // FIXME: does not belong in this base method=0A=
treeView.Model =3D store;=0A=
AutoCreateTreeViewColumns (treeView);=0A=
}=0A=
@@ -263,9 +290,6 @@=0A=
}=0A=
}=0A=
=0A=
- // TODO: maybe need to create =0A=
- // a DataGridColumnCollection of DataGridColumn=0A=
- // and a DataGridColumn contain a TreeViewColumn=0A=
public TreeViewColumn CreateColumn (TreeView theTreeView, int col, =0A=
string columnName) =0A=
{=0A=
Index: DbProvider.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/sqlsharpgtk/sqlsharpgtk/DbProvider.cs,v=0A=
retrieving revision 1.1.1.1=0A=
diff -u -r1.1.1.1 DbProvider.cs=0A=
--- DbProvider.cs 17 Oct 2003 04:11:49 -0000 1.1.1.1=0A=
+++ DbProvider.cs 21 Oct 2004 05:54:09 -0000=0A=
@@ -2,9 +2,9 @@=0A=
// DbProvider.cs=0A=
//=0A=
// Author:=0A=
-// Daniel Morgan <danmorg@sc.rr.com>=0A=
+// Daniel Morgan <danielmorgan@verizon.net>=0A=
//=0A=
-// (C)Copyright 2002 by Daniel Morgan=0A=
+// (C)Copyright 2002-2004 by Daniel Morgan=0A=
//=0A=
// To be included with Mono as a SQL query tool licensed under the GPL =
license.=0A=
//=0A=
@@ -14,6 +14,13 @@=0A=
using System;=0A=
using System.Data;=0A=
=0A=
+ public enum LoadProviderType=20
+ {=0A=
+ Internal, // Internal Type to System.Data=0A=
+ ExternalFullyQualified, // External Type to System.Data - Load Type =
from External Assembly - Load =0A=
+ ExternalPartial // External Type to System.Data - Load Type =
from External Assembly - LoadPartial=0A=
+ }=0A=
+=0A=
public class DbProvider =0A=
{=0A=
string key; // unique key to identify this provider - SYBASE=0A=
@@ -24,9 +31,7 @@=0A=
// the class that implements IDbConnection=0A=
// - Mono.Data.SybaseClient.SybaseConnection=0A=
=0A=
- bool internalProvider; // true =3D exists in System.Data.dll=0A=
- // false =3D provider is external and=0A=
- // must be loaded dynamically=0A=
+ LoadProviderType internalProvider;=0A=
=0A=
public string Key {=0A=
get {=0A=
@@ -58,7 +63,7 @@=0A=
}=0A=
}=0A=
=0A=
- public bool InternalProvider {=0A=
+ public LoadProviderType InternalProvider {=0A=
get {=0A=
return internalProvider;=0A=
}=0A=
@@ -66,7 +71,7 @@=0A=
=0A=
public DbProvider(string key, string name, string assembly,=0A=
string connectionClass, string adapterClass, =0A=
- bool internalProvider) =0A=
+ LoadProviderType internalProvider) =0A=
{=0A=
this.key =3D key;=0A=
this.name =3D name;=0A=
Index: DbProviderCollection.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/sqlsharpgtk/sqlsharpgtk/DbProviderCollection.cs,v=0A=
retrieving revision 1.1.1.1=0A=
diff -u -r1.1.1.1 DbProviderCollection.cs=0A=
--- DbProviderCollection.cs 17 Oct 2003 04:11:49 -0000 1.1.1.1=0A=
+++ DbProviderCollection.cs 21 Oct 2004 05:54:09 -0000=0A=
@@ -2,9 +2,9 @@=0A=
// DbProviderCollection.cs=0A=
//=0A=
// Author:=0A=
-// Daniel Morgan <danmorg@sc.rr.com>=0A=
+// Daniel Morgan <danielmorgan@verizon.net>=0A=
//=0A=
-// (C)Copyright 2002 by Daniel Morgan=0A=
+// (C)Copyright 2002-2004 by Daniel Morgan=0A=
//=0A=
// To be included with Mono as a SQL query tool licensed under the GPL =
license.=0A=
//=0A=
Index: FileSelectionDialog.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/sqlsharpgtk/sqlsharpgtk/FileSelectionDialog.cs,v=0A=
retrieving revision 1.1.1.1=0A=
diff -u -r1.1.1.1 FileSelectionDialog.cs=0A=
--- FileSelectionDialog.cs 17 Oct 2003 04:11:49 -0000 1.1.1.1=0A=
+++ FileSelectionDialog.cs 21 Oct 2004 05:54:09 -0000=0A=
@@ -2,10 +2,10 @@=0A=
// FileSelectionDialog.cs=0A=
//=0A=
// Author: Duncan Mak (duncan@ximian.com)=0A=
-// Daniel Morgan <danmorg@sc.rr.com>=0A=
+// Daniel Morgan <danielmorgan@verizon.net>=0A=
//=0A=
// Copyright (C) 2002, Duncan Mak, Ximian Inc.=0A=
-// Copyright (C) 2002, Daniel Morgan=0A=
+// Copyright (C) 2002-2004, Daniel Morgan=0A=
//=0A=
=0A=
using System;=0A=
Index: LoginDialog.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/sqlsharpgtk/sqlsharpgtk/LoginDialog.cs,v=0A=
retrieving revision 1.2=0A=
diff -u -r1.2 LoginDialog.cs=0A=
--- LoginDialog.cs 11 Jan 2004 05:27:58 -0000 1.2=0A=
+++ LoginDialog.cs 21 Oct 2004 05:54:09 -0000=0A=
@@ -135,7 +135,7 @@=0A=
=0A=
} catch (Exception e) {=0A=
sqlSharp.AppendText(sqlSharp.buf, =0A=
- "Error: Unable to connect.");=0A=
+ "Error: Unable to connect. Reason: " + e);=0A=
}=0A=
dialog.Destroy ();=0A=
dialog =3D null;=0A=
Index: Makefile=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/sqlsharpgtk/sqlsharpgtk/Makefile,v=0A=
retrieving revision 1.4=0A=
diff -u -r1.4 Makefile=0A=
--- Makefile 8 Jun 2004 23:15:17 -0000 1.4=0A=
+++ Makefile 21 Oct 2004 05:54:09 -0000=0A=
@@ -18,7 +18,7 @@=0A=
all : $(PROJECT)=0A=
=0A=
$(PROJECT) : $(SOURCES)=0A=
- $(CSC) -o $(PROJECT) $(SOURCES) $(SQLSHARP_GTK_LIBS)=0A=
+ $(CSC) -target:winexe -o $(PROJECT) $(SOURCES) $(SQLSHARP_GTK_LIBS)=0A=
=0A=
clean:=0A=
rm *.exe=0A=
Index: sqlsharpgtk.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/sqlsharpgtk/sqlsharpgtk/sqlsharpgtk.cs,v=0A=
retrieving revision 1.4=0A=
diff -u -r1.4 sqlsharpgtk.cs=0A=
--- sqlsharpgtk.cs 27 Mar 2004 23:16:51 -0000 1.4=0A=
+++ sqlsharpgtk.cs 21 Oct 2004 05:54:10 -0000=0A=
@@ -1,6 +1,5 @@=0A=
//=0A=
-// SqlSharpGtk - Mono SQL# For GTK# - SQL Query and Configuration tool =
for =0A=
-// Mono.Data providers=0A=
+// SqlSharpGtk - Mono SQL Query For GTK#=0A=
//=0A=
// Author:=0A=
// Daniel Morgan <danielmorgan@verizon.net>=0A=
@@ -88,7 +87,7 @@=0A=
=0A=
private Gtk.Window win;=0A=
=0A=
- public static readonly string ApplicationName =3D "Mono SQL# For =
GTK#";=0A=
+ public static readonly string ApplicationName =3D "Mono SQL Query";=0A=
=0A=
private OutputResults outputResults;=0A=
=0A=
@@ -115,7 +114,6 @@=0A=
win.DeleteEvent +=3D new Gtk.DeleteEventHandler(OnWindow_Delete);=0A=
win.BorderWidth =3D 4;=0A=
win.SetDefaultSize (450, 300);=0A=
- // win.DefaultSize =3D new Gtk.Size (450, 300);=0A=
=0A=
VBox vbox =3D new VBox (false, 4);=0A=
win.Add (vbox);=0A=
@@ -236,7 +234,6 @@=0A=
{=0A=
if (o is TextView) {=0A=
TextView tv =3D (TextView) o;=0A=
- //Gdk.EventKey k =3D args.Event;=0A=
=0A=
// if the F5 key was pressed=0A=
if (args.Event.KeyValue =3D=3D 0xFFC2) {=0A=
@@ -270,94 +267,81 @@=0A=
// TODO: use the ProviderFactory in Mono.Data =0A=
// to load providers=0A=
// instead of what's below=0A=
+ // or create you're own configuration dialog=0A=
public void LoadProviders () =0A=
{=0A=
providerList =3D new DbProviderCollection ();=0A=
- =0A=
- providerList.Add (new DbProvider (=0A=
- "MYSQL",=0A=
- "MySQL (Mono)",=0A=
- "Mono.Data.MySql",=0A=
- "Mono.Data.MySql.MySqlConnection",=0A=
- "Mono.Data.MySql.MySqlDataAdapter",=0A=
- false ));=0A=
+=0A=
providerList.Add (new DbProvider (=0A=
"MYSQLNET",=0A=
- "MySQL (ByteFX)",=0A=
- "ByteFX.Data",=0A=
- "ByteFX.Data.MySQLClient.MySQLConnection",=0A=
- "ByteFX.Data.MySQLClient.MySQLDataAdapter",=0A=
- false ));=0A=
- providerList.Add (new DbProvider (=0A=
- "POSTGRESQL",=0A=
- "PostgreSQL (Mono)",=0A=
- "Mono.Data.PostgreSqlClient",=0A=
- "Mono.Data.PostgreSqlClient.PgSqlConnection",=0A=
- "Mono.Data.PostgreSqlClient.PgSqlDataAdapter",=0A=
- false ));=0A=
+ "MySQL",=0A=
+ "ByteFX.Data, Version=3D0.7.6.1, Culture=3Dneutral, =
PublicKeyToken=3D0738eb9f132ed756",=0A=
+ "ByteFX.Data.MySqlClient.MySqlConnection",=0A=
+ "ByteFX.Data.MySqlClient.MySqlDataAdapter",=0A=
+ LoadProviderType.ExternalFullyQualified ));=0A=
providerList.Add (new DbProvider (=0A=
"NPGSQL",=0A=
- "PostgreSQL (Npgsql)",=0A=
- "Npgsql",=0A=
+ "PostgreSQL",=0A=
+ "Npgsql, Version=3D1.0.5000.0, Culture=3Dneutral, =
PublicKeyToken=3D5d8b90d52f46fda7",=0A=
"Npgsql.NpgsqlConnection",=0A=
"Npgsql.NpgsqlDataAdapter",=0A=
- false ));=0A=
+ LoadProviderType.ExternalFullyQualified ));=0A=
providerList.Add (new DbProvider (=0A=
"SQLCLIENT",=0A=
"Microsoft SQL Server",=0A=
"",=0A=
"",=0A=
"",=0A=
- true ));=0A=
- providerList.Add (new DbProvider (=0A=
- "TDS",=0A=
- "TDS Generic",=0A=
- "Mono.Data.TdsClient",=0A=
- "Mono.Data.TdsClient.TdsConnection",=0A=
- "Mono.Data.TdsClient.TdsDataAdapter",=0A=
- false ));=0A=
+ LoadProviderType.Internal ));=0A=
providerList.Add (new DbProvider (=0A=
- "ODBC",=0A=
- "ODBC",=0A=
- "",=0A=
- "",=0A=
- "",=0A=
- true ));=0A=
+ "FIREBIRD",=0A=
+ "Firebird",=0A=
+ "FirebirdSql.Data.Firebird, Version=3D1.6.3.0, Culture=3Dneutral, =
PublicKeyToken=3De1b4f92304d7b12f",=0A=
+ "FirebirdSql.Data.Firebird.FbConnection",=0A=
+ "FirebirdSql.Data.Firebird.FbDataAdapter",=0A=
+ LoadProviderType.ExternalFullyQualified ));=0A=
providerList.Add (new DbProvider (=0A=
- "OLEDB",=0A=
- "OLE DB",=0A=
- "",=0A=
- "",=0A=
- "",=0A=
- true ));=0A=
+ "ORACLE",=0A=
+ "Oracle",=0A=
+ "System.Data.OracleClient, Version=3D1.0.5000.0, Culture=3Dneutral, =
PublicKeyToken=3Db77a5c561934e089",=0A=
+ "System.Data.OracleClient.OracleConnection",=0A=
+ "System.Data.OracleClient.OracleDataAdapter",=0A=
+ LoadProviderType.ExternalFullyQualified ));=0A=
providerList.Add (new DbProvider (=0A=
"SQLITE",=0A=
"SQL Lite",=0A=
- "Mono.Data.SqliteClient",=0A=
+ "Mono.Data.SqliteClient, Version=3D1.0.5000.0, Culture=3Dneutral, =
PublicKeyToken=3D0738eb9f132ed756",=0A=
"Mono.Data.SqliteClient.SqliteConnection",=0A=
"Mono.Data.SqliteClient.SqliteDataAdapter",=0A=
- false ));=0A=
+ LoadProviderType.ExternalFullyQualified ));=0A=
providerList.Add (new DbProvider (=0A=
"SYBASE",=0A=
"Sybase",=0A=
- "Mono.Data.SybaseClient",=0A=
+ "Mono.Data.SybaseClient, Version=3D1.0.5000.0, Culture=3Dneutral, =
PublicKeyToken=3D0738eb9f132ed756",=0A=
"Mono.Data.SybaseClient.SybaseConnection",=0A=
"Mono.Data.SybaseClient.SybaseDataAdapter",=0A=
- false ));=0A=
+ LoadProviderType.ExternalFullyQualified ));=0A=
providerList.Add (new DbProvider (=0A=
- "DB2",=0A=
- "IBM DB2",=0A=
- "Mono.Data.DB2Client",=0A=
- "Mono.Data.DB2Client.DB2ClientConnection",=0A=
- "Mono.Data.DB2Client.DB2ClientDataAdapter",=0A=
- false ));=0A=
- providerList.Add (new DbProvider (=0A=
- "ORACLE",=0A=
- "Oracle",=0A=
- "System.Data.OracleClient",=0A=
- "System.Data.OracleClient.OracleConnection",=0A=
- "System.Data.OracleClient.OracleDataAdapter",=0A=
- false ));=0A=
+ "ODBC",=0A=
+ "ODBC",=0A=
+ "System.Data, Version=3D1.0.5000.0, Culture=3Dneutral, =
PublicKeyToken=3Db77a5c561934e089",=0A=
+ "System.Data.Odbc.OdbcConnection",=0A=
+ "System.Data.Odbc.OdbcDataAdapter",=0A=
+ LoadProviderType.ExternalFullyQualified ));=0A=
+ providerList.Add (new DbProvider (
+ "OLEDB",
+ "OLE DB",
+ "",
+ "",
+ "",
+ LoadProviderType.Internal ));
+ providerList.Add (new DbProvider (
+ "TDS",
+ "Old Sybase/SQL Server Databases",
+ "Mono.Data.TdsClient, Version=3D1.0.5000.0, Culture=3Dneutral, =
PublicKeyToken=3D0738eb9f132ed756",
+ "Mono.Data.TdsClient.TdsConnection",
+ "Mono.Data.TdsClient.TdsDataAdapter",
+ LoadProviderType.ExternalFullyQualified ));=0A=
}=0A=
=0A=
public MenuBar CreateMenuBar () =0A=
@@ -397,7 +381,7 @@=0A=
item =3D new MenuItem ("Close");=0A=
item.Activated +=3D new EventHandler (OnMenu_FileClose);=0A=
menu.Append (item);=0A=
-=0A=
+/*=0A=
menu.Append (new SeparatorMenuItem ());=0A=
=0A=
// TODO: submenu Save Output=0A=
@@ -415,7 +399,7 @@=0A=
item =3D new MenuItem ("Save _Output...");=0A=
item.Submenu =3D submenu;=0A=
menu.Append (item);=0A=
-=0A=
+*/=0A=
menu.Append (new SeparatorMenuItem ());=0A=
=0A=
item =3D new MenuItem ("E_xit");=0A=
@@ -427,7 +411,7 @@=0A=
menuBar.Append (barItem);=0A=
=0A=
// Edit menu=0A=
-=0A=
+/* TODO: do the Edit menu - for now - comment out=0A=
menu =3D new Menu ();=0A=
=0A=
item =3D new MenuItem ("_Undo");=0A=
@@ -471,6 +455,7 @@=0A=
barItem =3D new MenuItem ("_Edit");=0A=
barItem.Submenu =3D menu;=0A=
menuBar.Append (barItem);=0A=
+*/=0A=
=0A=
// Session menu=0A=
menu =3D new Menu ();=0A=
@@ -547,14 +532,11 @@=0A=
public bool LoadExternalProvider (string strProviderAssembly,=0A=
string providerConnectionClass) =0A=
{ =0A=
- try {=0A=
- SqlSharpGtk.DebugWriteLine ("Loading external provider...");=0A=
+ try { =0A=
providerAssembly =3D null;=0A=
providerAssembly =3D Assembly.Load (strProviderAssembly);=0A=
- Type typ =3D providerAssembly.GetType (providerConnectionClass);=0A=
+ Type typ =3D providerAssembly.GetType (providerConnectionClass, =
true);=0A=
conn =3D (IDbConnection) Activator.CreateInstance (typ);=0A=
- =0A=
- SqlSharpGtk.DebugWriteLine ("External provider loaded.");=0A=
}=0A=
catch (Exception f) {=0A=
string errorMessage =3D String.Format (=0A=
@@ -853,8 +835,6 @@=0A=
return;=0A=
}=0A=
=0A=
- SqlSharpGtk.DebugWriteLine ("get text from SQL editor...");=0A=
-=0A=
// get text from SQL editor=0A=
try { =0A=
TextIter start_iter, end_iter;=0A=
@@ -880,10 +860,8 @@=0A=
}=0A=
=0A=
IDataReader reader =3D null;=0A=
- SqlSharpGtk.DebugWriteLine ("Executing SQL: " + sql);=0A=
=0A=
- if ((outputResults =3D=3D OutputResults.TextView && =0A=
- outputType =3D=3D ExecuteOutputType.Normal) ||=0A=
+ if (outputType =3D=3D ExecuteOutputType.Normal ||=0A=
outputType =3D=3D ExecuteOutputType.HtmlFile ||=0A=
outputType =3D=3D ExecuteOutputType.CsvFile) {=0A=
=0A=
@@ -940,34 +918,40 @@=0A=
reader =3D null;=0A=
}=0A=
else {=0A=
- DataTable dataTable =3D LoadDataTable (cmd);=0A=
+ //DataTable dataTable =3D LoadDataTable (cmd);=0A=
+ =0A=
switch(outputType) {=0A=
case ExecuteOutputType.Normal:=0A=
- AppendText("set DataGrid.DataSource to DataTable...");=0A=
- grid.DataSource =3D dataTable;=0A=
- AppendText("DataBind...");=0A=
- grid.DataBind ();=0A=
- AppendText("Clean up...");=0A=
+ AppendText("Load Grid...");=0A=
+ grid.DataLoad(reader);=0A=
+ //grid.DataSource =3D dataTable;=0A=
+ //grid.DataBind ();=0A=
// clean up=0A=
- grid.DataSource =3D null;=0A=
+ //grid.DataSource =3D null;=0A=
+ // clean up=0A=
+ reader.Close ();=0A=
+ reader.Dispose ();=0A=
+ reader =3D null;=0A=
+=0A=
break;=0A=
case ExecuteOutputType.XmlFile:=0A=
- AppendText("Create DataSet...");=0A=
DataSet dataSet =3D new DataSet();=0A=
- AppendText("Add DataTable to DataSet's DataTableCollection...");=0A=
+ DataTable dataTable =3D LoadDataTable (cmd); =0A=
dataSet.Tables.Add(dataTable);=0A=
AppendText("Write DataSet to XML file: " + =0A=
filename);=0A=
dataSet.WriteXml(filename);=0A=
- AppendText("Clean up...");=0A=
dataSet =3D null;=0A=
+ dataTable.Clear();=0A=
+ dataTable.Dispose();=0A=
+ dataTable =3D null;=0A=
+=0A=
break;=0A=
}=0A=
// clean up=0A=
- dataTable.Clear();=0A=
- dataTable.Dispose();=0A=
- dataTable =3D null;=0A=
- AppendText("Done.");=0A=
+ //dataTable.Clear();=0A=
+ //dataTable.Dispose();=0A=
+ //dataTable =3D null;=0A=
cmd.Dispose();=0A=
cmd =3D null;=0A=
}=0A=
@@ -1487,17 +1471,6 @@=0A=
return false;=0A=
}=0A=
break;=0A=
- case "ODBC":=0A=
- try {=0A=
- conn =3D new OdbcConnection ();=0A=
- }=0A=
- catch (Exception e) {=0A=
- msg =3D "Error: unable to create connection: " +=0A=
- e.Message;=0A=
- Error (msg);=0A=
- return false;=0A=
- }=0A=
- break;=0A=
case "OLEDB":=0A=
try {=0A=
conn =3D new OleDbConnection ();=0A=
@@ -1532,7 +1505,7 @@=0A=
{=0A=
string msg =3D "";=0A=
DbDataAdapter dbAdapter =3D null;=0A=
- if (dbProvider.InternalProvider =3D=3D true) {=0A=
+ if (dbProvider.InternalProvider.Equals(LoadProviderType.Internal)) {=0A=
dbAdapter =3D CreateInternalDataAdapter (cmd);=0A=
}=0A=
else {=0A=
@@ -1546,41 +1519,35 @@=0A=
string msg =3D "";=0A=
DbDataAdapter dbAdapter =3D null;=0A=
string providerKey =3D dbProvider.Key;=0A=
- switch (providerKey.ToUpper ()) {=0A=
- case "SQLCLIENT":=0A=
- try {=0A=
- dbAdapter =3D new SqlDataAdapter (cmd as SqlCommand);=0A=
- }=0A=
- catch (Exception e) {=0A=
- msg =3D "Error: unable to create adapter: " +=0A=
- e.Message;=0A=
- Error (msg);=0A=
- return null;=0A=
- }=0A=
- break;=0A=
+ switch (providerKey.ToUpper ())=20
+ {=0A=
+ case "SQLCLIENT":=0A=
+ try=20
+ {=0A=
+ dbAdapter =3D new SqlDataAdapter (cmd as SqlCommand);=0A=
+ }=0A=
+ catch (Exception e)=20
+ {=0A=
+ msg =3D "Error: unable to create adapter: " +=0A=
+ e.Message;=0A=
+ Error (msg);=0A=
+ return null;=0A=
+ }=0A=
+ break;=0A=
=0A=
- case "OLEDB":=0A=
- try {=0A=
- dbAdapter =3D new OleDbDataAdapter (cmd as OleDbCommand);=0A=
- }=0A=
- catch (Exception e) {=0A=
- msg =3D "Error: unable to create adapter: " +=0A=
- e.Message;=0A=
- Error (msg);=0A=
- return null;=0A=
- }=0A=
- break;=0A=
- case "ODBC":=0A=
- try {=0A=
- dbAdapter =3D new OdbcDataAdapter (cmd as OdbcCommand);=0A=
+ case "OLEDB":=0A=
+ try=20
+ {=0A=
+ dbAdapter =3D new OleDbDataAdapter (cmd as OleDbCommand);=0A=
}=0A=
- catch (Exception e) {=0A=
+ catch (Exception e)=20
+ {=0A=
msg =3D "Error: unable to create adapter: " +=0A=
e.Message;=0A=
Error (msg);=0A=
return null;=0A=
}=0A=
- break;=0A=
+ break;=0A=
}=0A=
return dbAdapter;=0A=
}=0A=
@@ -1601,14 +1568,9 @@=0A=
{=0A=
string status =3D String.Empty;=0A=
=0A=
- AppendText("Create DbDataAdapter...");=0A=
SqlSharpDataAdapter adapter =3D new SqlSharpDataAdapter (dbcmd);=0A=
- =0A=
- AppendText("Create DataTable...");=0A=
DataTable dataTable =3D new DataTable ();=0A=
=0A=
- AppendText("Fill data into DataTable via DbDataAdapter...");=0A=
-=0A=
int rowsAddedOrRefreshed =3D 0;=0A=
IDataReader reader =3D null;=0A=
=0A=
@@ -1622,14 +1584,9 @@=0A=
}=0A=
=0A=
if (status.Equals(String.Empty)) {=0A=
- AppendText("Rows successfully Added or Refreshed in the DataTable: =
" + =0A=
- rowsAddedOrRefreshed);=0A=
int rowsAffected =3D reader.RecordsAffected;=0A=
- AppendText("Rows Affected: " + rowsAffected);=0A=
-=0A=
int fields =3D ((IDataRecord) reader).FieldCount;=0A=
- AppendText("Field Count: " + fields);=0A=
- =0A=
+=0A=
if (fields > 0) {=0A=
status =3D "Rows Selected: " + rowsAddedOrRefreshed +=0A=
" Fields: " + fields;=0A=
@@ -1647,7 +1604,6 @@=0A=
adapter.Dispose();=0A=
adapter =3D null;=0A=
=0A=
- AppendText("Return DataTable...");=0A=
return dataTable;=0A=
}=0A=
=0A=
@@ -1662,7 +1618,7 @@=0A=
conn =3D null;=0A=
=0A=
try {=0A=
- if (dbProvider.InternalProvider =3D=3D true) {=0A=
+ if (dbProvider.InternalProvider.Equals(LoadProviderType.Internal)) {=0A=
gotClass =3D OpenInternalProvider ();=0A=
} =0A=
else {=0A=
------=_NextPart_000_002A_01C4B711.71BE7210--