diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs index b104eb3f..7d96b0b6 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs @@ -219,7 +219,6 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution // Read until we hit the end of the result set await resultSet.ReadResultToEnd(cancellationToken).ConfigureAwait(false); - } while (await reader.NextResultAsync(cancellationToken)); // If there were no messages, for whatever reason (NO COUNT set, messages @@ -295,7 +294,17 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution private void StatementCompletedHandler(object sender, StatementCompletedEventArgs args) { // Add a message for the number of rows the query returned - resultMessages.Add(new ResultMessage(SR.QueryServiceAffectedRows(args.RecordCount))); + string message; + if (args.RecordCount == 1) + { + message = SR.QueryServiceAffectedOneRow; + } + else + { + message = SR.QueryServiceAffectedRows(args.RecordCount); + } + + resultMessages.Add(new ResultMessage(message)); } /// diff --git a/src/Microsoft.SqlTools.ServiceLayer/sr.Designer.cs b/src/Microsoft.SqlTools.ServiceLayer/sr.Designer.cs deleted file mode 100644 index 50d8c09d..00000000 --- a/src/Microsoft.SqlTools.ServiceLayer/sr.Designer.cs +++ /dev/null @@ -1,467 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.SqlTools.ServiceLayer { - using System; - using System.Reflection; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class sr { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - internal sr() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.SqlTools.ServiceLayer.sr", typeof(sr).GetTypeInfo().Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Connection details object cannot be null. - /// - public static string ConnectionParamsValidateNullConnection { - get { - return ResourceManager.GetString("ConnectionParamsValidateNullConnection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OwnerUri cannot be null or empty. - /// - public static string ConnectionParamsValidateNullOwnerUri { - get { - return ResourceManager.GetString("ConnectionParamsValidateNullOwnerUri", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ServerName cannot be null or empty. - /// - public static string ConnectionParamsValidateNullServerName { - get { - return ResourceManager.GetString("ConnectionParamsValidateNullServerName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} cannot be null or empty when using SqlLogin authentication. - /// - public static string ConnectionParamsValidateNullSqlAuth { - get { - return ResourceManager.GetString("ConnectionParamsValidateNullSqlAuth", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Connection parameters cannot be null. - /// - public static string ConnectionServiceConnectErrorNullParams { - get { - return ResourceManager.GetString("ConnectionServiceConnectErrorNullParams", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid value '{0}' for AuthenticationType. Valid values are 'Integrated' and 'SqlLogin'.. - /// - public static string ConnectionServiceConnStringInvalidAuthType { - get { - return ResourceManager.GetString("ConnectionServiceConnStringInvalidAuthType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid value '{0}' for ApplicationIntent. Valid values are 'ReadWrite' and 'ReadOnly'.. - /// - public static string ConnectionServiceConnStringInvalidIntent { - get { - return ResourceManager.GetString("ConnectionServiceConnStringInvalidIntent", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SpecifiedUri '{0}' does not have existing connection. - /// - public static string ConnectionServiceListDbErrorNotConnected { - get { - return ResourceManager.GetString("ConnectionServiceListDbErrorNotConnected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OwnerUri cannot be null or empty. - /// - public static string ConnectionServiceListDbErrorNullOwnerUri { - get { - return ResourceManager.GetString("ConnectionServiceListDbErrorNullOwnerUri", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Win32Credential object is already disposed. - /// - public static string CredentialServiceWin32CredentialDisposed { - get { - return ResourceManager.GetString("CredentialServiceWin32CredentialDisposed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid CriticalHandle!. - /// - public static string CredentialsServiceInvalidCriticalHandle { - get { - return ResourceManager.GetString("CredentialsServiceInvalidCriticalHandle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The password has exceeded 512 bytes. - /// - public static string CredentialsServicePasswordLengthExceeded { - get { - return ResourceManager.GetString("CredentialsServicePasswordLengthExceeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target must be specified to delete a credential. - /// - public static string CredentialsServiceTargetForDelete { - get { - return ResourceManager.GetString("CredentialsServiceTargetForDelete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target must be specified to check existance of a credential. - /// - public static string CredentialsServiceTargetForLookup { - get { - return ResourceManager.GetString("CredentialsServiceTargetForLookup", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Message header must separate key and value using ':'. - /// - public static string HostingHeaderMissingColon { - get { - return ResourceManager.GetString("HostingHeaderMissingColon", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fatal error: Content-Length header must be provided. - /// - public static string HostingHeaderMissingContentLengthHeader { - get { - return ResourceManager.GetString("HostingHeaderMissingContentLengthHeader", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fatal error: Content-Length value is not an integer. - /// - public static string HostingHeaderMissingContentLengthValue { - get { - return ResourceManager.GetString("HostingHeaderMissingContentLengthValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MessageReader's input stream ended unexpectedly, terminating. - /// - public static string HostingUnexpectedEndOfStream { - get { - return ResourceManager.GetString("HostingUnexpectedEndOfStream", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ({0} row(s) affected). - /// - public static string QueryServiceAffectedRows { - get { - return ResourceManager.GetString("QueryServiceAffectedRows", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The query has already completed, it cannot be cancelled. - /// - public static string QueryServiceCancelAlreadyCompleted { - get { - return ResourceManager.GetString("QueryServiceCancelAlreadyCompleted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Query successfully cancelled, failed to dispose query. Owner URI not found.. - /// - public static string QueryServiceCancelDisposeFailed { - get { - return ResourceManager.GetString("QueryServiceCancelDisposeFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to (No column name). - /// - public static string QueryServiceColumnNull { - get { - return ResourceManager.GetString("QueryServiceColumnNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Command(s) copleted successfully.. - /// - public static string QueryServiceCompletedSuccessfully { - get { - return ResourceManager.GetString("QueryServiceCompletedSuccessfully", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Maximum number of bytes to return must be greater than zero. - /// - public static string QueryServiceDataReaderByteCountInvalid { - get { - return ResourceManager.GetString("QueryServiceDataReaderByteCountInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Maximum number of chars to return must be greater than zero. - /// - public static string QueryServiceDataReaderCharCountInvalid { - get { - return ResourceManager.GetString("QueryServiceDataReaderCharCountInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Maximum number of XML bytes to return must be greater than zero. - /// - public static string QueryServiceDataReaderXmlCountInvalid { - get { - return ResourceManager.GetString("QueryServiceDataReaderXmlCountInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Msg {0}, Level {1}, State {2}, Line {3}{4}{5}. - /// - public static string QueryServiceErrorFormat { - get { - return ResourceManager.GetString("QueryServiceErrorFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileStreamWrapper must be initialized before performing operations. - /// - public static string QueryServiceFileWrapperNotInitialized { - get { - return ResourceManager.GetString("QueryServiceFileWrapperNotInitialized", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This FileStreamWrapper cannot be used for writing. - /// - public static string QueryServiceFileWrapperReadOnly { - get { - return ResourceManager.GetString("QueryServiceFileWrapperReadOnly", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Access method cannot be write-only. - /// - public static string QueryServiceFileWrapperWriteOnly { - get { - return ResourceManager.GetString("QueryServiceFileWrapperWriteOnly", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sender for OnInfoMessage event must be a SqlConnection. - /// - public static string QueryServiceMessageSenderNotSql { - get { - return ResourceManager.GetString("QueryServiceMessageSenderNotSql", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A query is already in progress for this editor session. Please cancel this query or wait for its completion.. - /// - public static string QueryServiceQueryInProgress { - get { - return ResourceManager.GetString("QueryServiceQueryInProgress", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This editor is not connected to a database. - /// - public static string QueryServiceQueryInvalidOwnerUri { - get { - return ResourceManager.GetString("QueryServiceQueryInvalidOwnerUri", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The requested query does not exist. - /// - public static string QueryServiceRequestsNoQuery { - get { - return ResourceManager.GetString("QueryServiceRequestsNoQuery", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not retrieve column schema for result set. - /// - public static string QueryServiceResultSetNoColumnSchema { - get { - return ResourceManager.GetString("QueryServiceResultSetNoColumnSchema", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot read subset unless the results have been read from the server. - /// - public static string QueryServiceResultSetNotRead { - get { - return ResourceManager.GetString("QueryServiceResultSetNotRead", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Reader cannot be null. - /// - public static string QueryServiceResultSetReaderNull { - get { - return ResourceManager.GetString("QueryServiceResultSetReaderNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Row count must be a positive integer. - /// - public static string QueryServiceResultSetRowCountOutOfRange { - get { - return ResourceManager.GetString("QueryServiceResultSetRowCountOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Start row cannot be less than 0 or greater than the number of rows in the result set. - /// - public static string QueryServiceResultSetStartRowOutOfRange { - get { - return ResourceManager.GetString("QueryServiceResultSetStartRowOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Batch index cannot be less than 0 or greater than the number of batches. - /// - public static string QueryServiceSubsetBatchOutOfRange { - get { - return ResourceManager.GetString("QueryServiceSubsetBatchOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The query has not completed, yet. - /// - public static string QueryServiceSubsetNotCompleted { - get { - return ResourceManager.GetString("QueryServiceSubsetNotCompleted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Result set index cannot be less than 0 or greater than the number of result sets. - /// - public static string QueryServiceSubsetResultSetOutOfRange { - get { - return ResourceManager.GetString("QueryServiceSubsetResultSetOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Start position ({0}, {1}) must come before or be equal to the end position ({2}, {3}). - /// - public static string WorkspaceServiceBufferPositionOutOfOrder { - get { - return ResourceManager.GetString("WorkspaceServiceBufferPositionOutOfOrder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Position is outside of column range for line {0}. - /// - public static string WorkspaceServicePositionColumnOutOfRange { - get { - return ResourceManager.GetString("WorkspaceServicePositionColumnOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Position is outside of file line range. - /// - public static string WorkspaceServicePositionLineOutOfRange { - get { - return ResourceManager.GetString("WorkspaceServicePositionLineOutOfRange", resourceCulture); - } - } - } -} diff --git a/src/Microsoft.SqlTools.ServiceLayer/sr.cs b/src/Microsoft.SqlTools.ServiceLayer/sr.cs index dbe3bac6..ef1c9526 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/sr.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/sr.cs @@ -245,6 +245,14 @@ namespace Microsoft.SqlTools.ServiceLayer } } + public static string QueryServiceAffectedOneRow + { + get + { + return Keys.GetString(Keys.QueryServiceAffectedOneRow); + } + } + public static string QueryServiceCompletedSuccessfully { get @@ -487,6 +495,9 @@ namespace Microsoft.SqlTools.ServiceLayer public const string QueryServiceFileWrapperReadOnly = "QueryServiceFileWrapperReadOnly"; + public const string QueryServiceAffectedOneRow = "QueryServiceAffectedOneRow"; + + public const string QueryServiceAffectedRows = "QueryServiceAffectedRows"; diff --git a/src/Microsoft.SqlTools.ServiceLayer/sr.resx b/src/Microsoft.SqlTools.ServiceLayer/sr.resx index ebcaa126..27f0993d 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/sr.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/sr.resx @@ -245,13 +245,17 @@ This FileStreamWrapper cannot be used for writing + + (1 row affected) + + - ({0} row(s) affected) + ({0} rows affected) . Parameters: 0 - rows (long) - Command(s) copleted successfully. + Commands completed successfully. diff --git a/src/Microsoft.SqlTools.ServiceLayer/sr.strings b/src/Microsoft.SqlTools.ServiceLayer/sr.strings index 35bca9c5..9b9a138e 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/sr.strings +++ b/src/Microsoft.SqlTools.ServiceLayer/sr.strings @@ -107,9 +107,11 @@ QueryServiceFileWrapperReadOnly = This FileStreamWrapper cannot be used for writ ### Query Request -QueryServiceAffectedRows(long rows) = ({0} row(s) affected) +QueryServiceAffectedOneRow = (1 row affected) -QueryServiceCompletedSuccessfully = Command(s) copleted successfully. +QueryServiceAffectedRows(long rows) = ({0} rows affected) + +QueryServiceCompletedSuccessfully = Commands completed successfully. QueryServiceErrorFormat(int msg, int lvl, int state, int line, string newLine, string message) = Msg {0}, Level {1}, State {2}, Line {3}{4}{5}