I've tried several times to upgrade 2SXC content from 8.2.3 to 9.6.1 and keep running into an installation error. This is a site that was previously on 7.2.2 and then upgraded to 9.1.1. I received the same error on both versions.
Steps to Reproduce:
Go to the Extensions page in DNN 9.1.1 with 2SXC 8.2.3 installed
Upload and attempt to upgrade 2SXC to version 9.6.1
Expected Behavior:
The upgrade occurs without error.
Actual Behavior:
There is an error during upgrade, but the module appears to be upgraded when you reload the extensions page.
https://www.screencast.com/t/Y8Gk2ZuzLl
There are specific upgrade errors, but there are a large number of other errors cascaded as well.
2017-10-23 09:17:27,066 [UPENDO-PC1][Thread:30][ERROR] DotNetNuke.Data.SqlDataProvider - System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Packages'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script, Int32 timeoutSec)
ClientConnectionId:7df9af36-80ea-46e0-8760-f33a2536071b
Error Number:208,State:1,Class:16
2017-10-23 09:17:27,150 [UPENDO-PC1][Thread:30][ERROR] DotNetNuke.Services.Installer.Log.Logger - SQL Execution resulted in following Exceptions:
System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Packages'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script, Int32 timeoutSec)
ClientConnectionId:7df9af36-80ea-46e0-8760-f33a2536071b
Error Number:208,State:1,Class:16
-- This SQL file is used for the app-module package (in .dnn manifest file) which must not be installed or upgraded if the 2sxc module fails to install
DECLARE #RequiredVersion int
SET #RequiredVersion = 9
DECLARE #RequiredVersionIsInstalled int
SELECT #RequiredVersionIsInstalled = CASE WHEN EXISTS(SELECT * FROM Packages WHERE Name = N'2SexyContent' AND CONVERT(int, LEFT([Version], CHARINDEX('.', [Version])-1)) >= #RequiredVersion) THEN CAST (1 AS BIT) ELSE CAST (0 AS BIT) END
If #RequiredVersionIsInstalled = 0
BEGIN
RAISERROR(N'2sxc 9 or newer must be installed for the app module to install. Probably something else went wrong while installing - see previous errors for more information. ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************', 16, 1)
RETURN
END
2017-10-23 09:17:27,224 [UPENDO-PC1][Thread:30][ERROR] DotNetNuke.Services.Installer.Log.Logger - Installation Failed - Script
2017-10-23 09:17:27,634 [UPENDO-PC1][Thread:30][ERROR] DotNetNuke.Services.Installer.Log.Logger - Package Installation aborted
2017-10-23 09:20:32,338 [UPENDO-PC1][Thread:9][ERROR] DotNetNuke.Services.Exceptions.Exceptions - System.NullReferenceException: Object reference not set to an instance of an object.
at ToSic.SexyContent.Environment.Dnn7.ImportExportEnvironment.SaveOptions(Int32 zoneId) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\Environment\Dnn7\ImportExportEnvironment.cs:line 186
at ToSic.Eav.Apps.ImportExport.Import..ctor(Nullable`1 zoneId, Int32 appId, Boolean skipExistingAttributes, Boolean preserveUntouchedAttributes, Log parentLog)
at ToSic.Eav.Apps.ImportExport.XmlImportWithFiles.ImportXml(Int32 zoneId, Int32 appId, XDocument doc, Boolean leaveExistingValuesUntouched)
at ToSic.SexyContent.Installer.V8.Version080302() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer\V8.cs:line 105
at ToSic.SexyContent.Installer.InstallationController.UpgradeModule(String version) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer\InstallationController.cs:line 187
at ToSic.SexyContent.Environment.Dnn7.DnnBusinessController.UpgradeModule(String version) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\Environment\Dnn7\DnnBusinessController.cs:line 75
at DotNetNuke.Entities.Modules.EventMessageProcessor.UpgradeModule(EventMessage message)
2017-10-23 09:21:34,131 [UPENDO-PC1][Thread:11][ERROR] DotNetNuke.Framework.Reflection - ToSic.SexyContent.SexyContent
System.Web.HttpException (0x80004005): Could not load type 'ToSic.SexyContent.SexyContent'.
at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at DotNetNuke.Framework.Reflection.CreateType(String TypeName, String CacheKey, Boolean UseCache, Boolean IgnoreErrors)
2017-10-23 09:21:34,147 [UPENDO-PC1][Thread:11][ERROR] DotNetNuke.Services.Search.ModuleIndexer - System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at DotNetNuke.Services.Search.ModuleIndexer.GetModulesForIndex(Int32 portalId)
2017-10-23 09:21:34,162 [UPENDO-PC1][Thread:11][ERROR] DotNetNuke.Services.Exceptions.Exceptions - System.Exception: Error Creating BusinessControllerClass 'ToSic.SexyContent.SexyContent' of module(2sxc-app) id=(3183) in tab(958) and portal(8) ---> System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at DotNetNuke.Services.Search.ModuleIndexer.GetModulesForIndex(Int32 portalId)
--- End of inner exception stack trace ---
at DotNetNuke.Services.Search.ModuleIndexer.ThrowLogError(ModuleInfo module, Exception ex)
Has anyone else run into this, and do you know how to resolve it?
I believe you already found it - but check https://2sxc.org/en/blog/post/upgrading-to-2sxc-9-3-requires-2sxc-7
This actually was resolved by adding the missing {databaseOwner} and {objectQualifier} tokens to the SqlDataProvider script. It can be seen in the pull request below.
https://github.com/2sic/2sxc/pull/1363
Related
I am using the below code and every time I run the code, I do see the break point hitting in LogErrorToDatabase method. However sometimes I see the log entry for the ErrorGuid in the database and sometimes I do not see any log entries. The ErrorGuid gets returned to the client side but missing DB entry.
public async Task<ActionResult<IEnumerable<Location>>> Get()
{
try {
Log.Information("Inside Locations Get");
int a = int.Parse("?"); //Uncomment to test error handling
return await Repo.Get<Location>().ToListAsync();
}
catch (Exception ex)
{
//Log error
var id = Guid.NewGuid();
await LogErrorToDatabase(ex, id);
return BadRequest(new ErrorDetail()
{
ErrorGuid = id
});
}
}
public async Task LogErrorToDatabase(Exception ex, Guid id)
{
await Task.Run(() => Log.ForContext("ErrorGuid", id)
.Error(ex, "Error occured with getting the Location List"));
}
I have no clue on this randomness. Any help will be appreciated.
There are several steps you can take troubleshoot why messages are not being written to the Serilog Sink. You can see a number of them on another answer here in SO:
Serilog MSSQL Sink doesn't write logs to database
Update: String or binary data would be truncated is a common SQL Server exception that happens when you're trying to store a value that is larger than the table field can store. For example, if you have an nvarchar(4) field and try to store abcde (5 characters) you'll get the same kind of exception.
You either have to increase the size of the fields in the database you're using to store information, or you have to limit the number of characters you're logging in your C# code.
Thanks Calo. Your response was helpful. I turned the Audit on by switching from WriteTo to AuditTo, set "period": 1 and added Log.CloseAndFlush(); and get the below error logged to my SQL database. Help will be appreciated.
System.AggregateException: Failed to emit a log event. (String or binary data would be truncated.
The statement has been terminated.)
---> System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite, String method)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Serilog.Sinks.MSSqlServer.MSSqlServerAuditSink.Emit(LogEvent logEvent)
at Serilog.Core.Sinks.AggregateSink.Emit(LogEvent logEvent)
ClientConnectionId:c0e1f1a4-b655-4be1-b655-c8954f44d299
Error Number:8152,State:2,Class:16
--- End of inner exception stack trace ---
at Serilog.Core.Sinks.AggregateSink.Emit(LogEvent logEvent)
at Serilog.Core.Logger.Dispatch(LogEvent logEvent)
at Serilog.Core.Logger.Serilog.Core.ILogEventSink.Emit(LogEvent logEvent)
at Serilog.Core.Logger.Dispatch(LogEvent logEvent)
at Serilog.Core.Logger.Serilog.Core.ILogEventSink.Emit(LogEvent logEvent)
at Serilog.Core.Logger.Dispatch(LogEvent logEvent)
at Serilog.Core.Logger.Write(LogEventLevel level, Exception exception, String messageTemplate, Object[] propertyValues)
at Serilog.Core.Logger.Write(LogEventLevel level, String messageTemplate, Object[] propertyValues)
at Serilog.Core.Logger.Write[T0,T1,T2](LogEventLevel level, String messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2)
at Serilog.Core.Logger.Error[T0,T1,T2](String messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2)
at MCF.API.ExtensionHelpers.ExceptionMiddleware.InvokeAsync(HttpContext httpContext) in
I wonder if anyone can help me out, we have a Umbraco installation running:
OS: Microsoft Windows Server 2016 Standard, v10.0.14393 Build 14393
SQL Server: SQL Server 2016 Standard Edition, v13.0.1728.2
Umbraco: v7.3.4
The server had a scheduled reboot this morning at 5 am, from then, we've can't get the application back online, every time we go to the site we get the following error:
[Win32Exception (0x80004005): The wait operation timed out]
[SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed before completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +2442598
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +5766516
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4162
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +58
System.Data.SqlClient.SqlDataReader.get_MetaData() +89
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) +409
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2031
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +911
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +64
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +240
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +41
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +12
StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) +68
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +14
Umbraco.Core.Persistence.<Query>d__71.MoveNext() +265
I can't see any updates have run and looked at the windows update logs there isn't anything there neither.
I've tried
Restarting the server
Restarting the application pool.
Restarting IIS
Increase timeout to 6000.
If anyone can shed any more light on this it would be great.
You need to increase the command timeout from the default of 30 seconds. It's a property of the DbCommand object.
See here:
https://learn.microsoft.com/en-us/dotnet/api/system.data.common.dbcommand.commandtimeout?view=netframework-4.8
I'd suggest you change it to the value 0 (i.e. unlimited)
I have an ASP.NET Core app [Microsoft.AspNetCore.App 2.1.4] with EF Core 2.1.4 [DbContext pooling enabled] and data stored on an Azure SQL database.
Occasinaly [once in 1-2 days] I get unrecoverable error stating System.Data.SqlClient.SqlException (0x80131904): The incoming tabular data stream (TDS) protocol stream is incorrect. The MARS TDS header contained errors.
Once I restart the app, everything resumes working until it happens again.
Probably import to note is that I don't have MultipleActiveResultSets enabled in my connection string at all, which makes the issue even more strange.
Has anyone else noticed something similar? Are there any ways I can trace the problem?
Stack trace:
System.Data.SqlClient.SqlException (0x80131904): The incoming tabular data stream (TDS) protocol stream is incorrect. The MARS TDS header contained errors.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.BufferlessMoveNext(DbContext _, Boolean buffer)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Inviton.Web.Portal.Controllers.EventListController.GetEvents(BL bl, Int32 venueId, Int32 promoterId)
---snip---
For all the ones who are still facing this problem and ends up on this page.
There's a open issue on SqlCLient https://github.com/dotnet/SqlClient/issues/85
As of today is not fixed.
But there's a hackaroud which mitigate it https://github.com/dotnet/SqlClient/issues/85#issuecomment-469432914
This worked for me:
Right Click your Project -> Manage nuget packages -> Updates.
Update Microsoft.Data.SqlClient to last version.
It's similar to this question, but it contains no fix: TCP Provider: The semaphore timeout period has expired
I am using the enterprise lib transient fault handling (v 6.x) with a retry policy. I have used it for years and this error is a new one. Perhaps due to Windows update on our webserver (win 2012r2)
So since there is no C# code changed and I am using the enterprise lib for ages... it must be windows/hardware related?
I have found this, saying it's winsock related and some source about usb drivers?
There is a known issue with vip swaps, but we are running the webapps (both webforms and mvc apps have this issue) from our own on prem 2012r2
Here is one of the stacktraces:
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
System.Data.SqlClient.SqlDataReader.get_MetaData()
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
Shop.Dal.DB.<>c__DisplayClass2_0.<GetDatatable>b__0()
Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0()
Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
Shop.Dal.DB.GetDatatable(SqlCommand com) The semaphore timeout period has expired
I have made a Web application with the Data Base, in sql server express
I open the server and built the tables in visual studio (I could not find another way)
When I went Data Base website (in online) is saying that I have no permissions,
Does anyone know how I add permissions through visual studio?
error:
Server Error in '/' Application.
The SELECT permission was denied on the object 'UsersTable', database
'master', schema 'dbo'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: The SELECT
permission was denied on the object 'UsersTable', database 'master',
schema 'dbo'.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): The SELECT permission was denied on the
object 'UsersTable', database 'master', schema 'dbo'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection, Action1 wrapCloseInAction) +3279580
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +791
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj, Boolean& dataReady) +4927
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +92
System.Data.SqlClient.SqlDataReader.get_MetaData() +102
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString) +552
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader
ds, Boolean describeParameterEncryptionRequest) +3114
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, TaskCompletionSource1 completion, Int32 timeout, Task& task,
Boolean asyncWrite) +554
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method) +98
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior, String method) +307
System.Data.SqlClient.SqlCommand.ExecuteReader() +132
KIP_FP.KIPDB.chackUser(String userN) in
C:\Users\Administrator\Documents\KIP-FP\KIP-FP\KIPDB.cs:31
KIP_FP.KIPBL.chackUser(String userN) in
C:\Users\Administrator\Documents\KIP-FP\KIP-FP\KIPBL.cs:37
KIP_FP.loginUserPage.Button1_Click(Object sender, EventArgs e) in
C:\Users\Administrator\Documents\KIP-FP\KIP-FP\Login.aspx.cs:34
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11750641
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +150 System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+6016
You have permission to make SELECT on the UsersTable table but Application Pool of your web application does not have it, because it is running under another user account which has no permission.
To add permission you have to run something like this:
USE master;
GRANT SELECT ON OBJECT::dbo.UsersTable TO PoolUser;
GO
But first you should find out which user is on App. Pool.