From: Date: June 11 2007 10:38pm Subject: Connector/NET commit: r754 - in trunk: . Driver/Source VisualStudio VisualStudio/Enumerators List-Archive: http://lists.mysql.com/commits/28529 Message-Id: <200706112038.l5BKc5rL001882@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added: trunk/VisualStudio/Enumerators/ trunk/VisualStudio/Enumerators/StoredProcedureColumnEnumerator.cs Modified: trunk/CHANGES trunk/Driver/Source/parameter.cs trunk/VisualStudio/MySqlDataObjectSupport.xml trunk/VisualStudio/MySqlDataViewSupport.xml Log: Fixed problem preventing use of stored procedures for insert, update, and delete statements in a table adapter. Modified: trunk/CHANGES =================================================================== --- trunk/CHANGES 2007-06-11 20:29:02 UTC (rev 753) +++ trunk/CHANGES 2007-06-11 20:38:04 UTC (rev 754) @@ -5,6 +5,8 @@ (See release notes) - Fixed problem preventing the DataSet Designer or TableAdapter wizard from being able to generate insert, update, and delete statements. (Bug #26347) + - Fixed problem preventing use of stored procedures for insert, update, and + delete statements in a table adapter. Version 5.1.1 - Fixed password property on MySqlConnectionStringBuilder to use PasswordPropertyText Modified: trunk/Driver/Source/parameter.cs =================================================================== --- trunk/Driver/Source/parameter.cs 2007-06-11 20:29:02 UTC (rev 753) +++ trunk/Driver/Source/parameter.cs 2007-06-11 20:38:04 UTC (rev 754) @@ -192,7 +192,7 @@ #if !CF [Category("Data")] #endif - public override ParameterDirection Direction + public override ParameterDirection Direction { get { return direction; } set { direction = value; } @@ -204,7 +204,7 @@ #if !CF [Browsable(false)] #endif - public override Boolean IsNullable + public override Boolean IsNullable { get { return isNullable; } set { isNullable = value; } @@ -215,8 +215,9 @@ /// #if !CF [Category("Data")] + [DbProviderSpecificTypeProperty(true)] #endif - public MySqlDbType MySqlDbType + public MySqlDbType MySqlDbType { get { return mySqlDbType; } set @@ -232,7 +233,7 @@ #if !CF [Category("Misc")] #endif - public override String ParameterName + public override String ParameterName { get { return paramName; } set @@ -249,7 +250,7 @@ #if !CF [Category("Data")] #endif - public byte Precision + public byte Precision { get { return precision; } set { precision = value; } @@ -261,7 +262,7 @@ #if !CF [Category("Data")] #endif - public byte Scale + public byte Scale { get { return scale; } set { scale = value; } @@ -273,7 +274,7 @@ #if !CF [Category("Data")] #endif - public override int Size + public override int Size { get { return size; } set { size = value; } @@ -285,7 +286,7 @@ #if !CF [Category("Data")] #endif - public override String SourceColumn + public override String SourceColumn { get { return sourceColumn; } set { sourceColumn = value; } @@ -297,7 +298,7 @@ #if !CF [Category("Data")] #endif - public override DataRowVersion SourceVersion + public override DataRowVersion SourceVersion { get { return sourceVersion; } set { sourceVersion = value; } @@ -310,7 +311,7 @@ [TypeConverter(typeof (StringConverter))] [Category("Data")] #endif - public override object Value + public override object Value { get { return paramValue; } set Added: trunk/VisualStudio/Enumerators/StoredProcedureColumnEnumerator.cs =================================================================== --- trunk/VisualStudio/Enumerators/StoredProcedureColumnEnumerator.cs 2007-06-11 20:29:02 UTC (rev 753) +++ trunk/VisualStudio/Enumerators/StoredProcedureColumnEnumerator.cs 2007-06-11 20:38:04 UTC (rev 754) @@ -0,0 +1,43 @@ +// Copyright (C) 2006-2007 MySQL AB +// +// This file is part of MySQL Tools for Visual Studio. +// MySQL Tools for Visual Studio is free software; you can redistribute it +// and/or modify it under the terms of the GNU Lesser General Public +// License version 2.1 as published by the Free Software Foundation +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; + +using System; +using Microsoft.VisualStudio.Data; +using System.Data.Common; +using Microsoft.VisualStudio.Data.AdoDotNet; +using System.Data; + +namespace MySql.Data.VisualStudio +{ + class StoredProcedureColumnEnumerator : DataObjectEnumerator + { + public override DataReader EnumerateObjects(string typeName, object[] items, + object[] restrictions, string sort, object[] parameters) + { + DataConnectionWrapper connectionWrapper = new DataConnectionWrapper(Connection); + string spName = String.Format("{0}.{1}", restrictions[1], restrictions[2]); + IDataReader reader = connectionWrapper.ExecuteReader(spName, true, CommandBehavior.SchemaOnly); + DataTable dt = reader.GetSchemaTable(); + reader.Close(); + + dt.Columns.Add(new DataColumn("RoutineName", typeof(string))); + foreach (DataRow row in dt.Rows) + row["RoutineName"] = restrictions[2]; + + return new AdoDotNetDataTableReader(dt); + } + } +} Modified: trunk/VisualStudio/MySqlDataObjectSupport.xml =================================================================== --- trunk/VisualStudio/MySqlDataObjectSupport.xml 2007-06-11 20:29:02 UTC (rev 753) +++ trunk/VisualStudio/MySqlDataObjectSupport.xml 2007-06-11 20:38:04 UTC (rev 754) @@ -11,7 +11,7 @@ - @@ -31,7 +31,7 @@ --> - + @@ -50,7 +50,7 @@ - + @@ -87,11 +87,11 @@ - - + - @@ -514,9 +514,9 @@ - + - + @@ -543,7 +543,7 @@ - + @@ -587,40 +587,40 @@ - + - + - + - + - - + + - + - + @@ -629,41 +629,33 @@ - + - + - - - - - + - + - - - - - + - + - + - + - - + + @@ -706,7 +698,7 @@ - + @@ -1095,5 +1087,5 @@ - + Modified: trunk/VisualStudio/MySqlDataViewSupport.xml =================================================================== --- trunk/VisualStudio/MySqlDataViewSupport.xml 2007-06-11 20:29:02 UTC (rev 753) +++ trunk/VisualStudio/MySqlDataViewSupport.xml 2007-06-11 20:38:04 UTC (rev 754) @@ -621,7 +621,7 @@ - +