Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I work on unity csharp . i try to execute multi query on sql sever database using async await threading on same time but i get error

so How to solve this error please and why this error generated and reasons for that

What I have tried:

SqlException: Snix_Connect (provider: SNI_PN7, error: 40 - SNI_ERROR_40)

Snix_Connect (provider: SNI_PN7, error: 40 - SNI_ERROR_40)

System.Data.SqlClient.SqlInternalConnectionTds..ctor (System.Data.ProviderBase.DbConnectionPoolIdentity identity, System.Data.SqlClient.SqlConnectionString connectionOptions, System.Object providerInfo, System.Boolean redirectedUserInstance, System.Data.SqlClient.SqlConnectionString userConnectionOptions, System.Data.SqlClient.SessionData reconnectSessionData, System.Boolean applyTransientFaultHandling) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.SqlClient.SqlConnectionFactory.CreateConnection (System.Data.Common.DbConnectionOptions options, System.Data.Common.DbConnectionPoolKey poolKey, System.Object poolGroupProviderInfo, System.Data.ProviderBase.DbConnectionPool pool, System.Data.Common.DbConnection owningConnection, System.Data.Common.DbConnectionOptions userOptions) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection (System.Data.Common.DbConnection owningConnection, System.Data.ProviderBase.DbConnectionPoolGroup poolGroup, System.Data.Common.DbConnectionOptions userOptions) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.ProviderBase.DbConnectionFactory.TryGetConnection (System.Data.Common.DbConnection owningConnection, System.Threading.Tasks.TaskCompletionSource`1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal oldConnection, System.Data.ProviderBase.DbConnectionInternal& connection) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal (System.Data.Common.DbConnection outerConnection, System.Data.ProviderBase.DbConnectionFactory connectionFactory, System.Threading.Tasks.TaskCompletionSource`1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection (System.Data.Common.DbConnection outerConnection, System.Data.ProviderBase.DbConnectionFactory connectionFactory, System.Threading.Tasks.TaskCompletionSource`1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.SqlClient.SqlConnection.TryOpen (System.Threading.Tasks.TaskCompletionSource`1[TResult] retry) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.SqlClient.SqlConnection.Open () (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.Common.DbDataAdapter.QuietOpen (System.Data.IDbConnection connection, System.Data.ConnectionState& originalState) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.Common.DbDataAdapter.FillInternal (System.Data.DataSet dataset, System.Data.DataTable[] datatables, System.Int32 startRecord, System.Int32 maxRecords, System.String srcTable, System.Data.IDbCommand command, System.Data.CommandBehavior behavior) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.Common.DbDataAdapter.Fill (System.Data.DataTable[] dataTables, System.Int32 startRecord, System.Int32 maxRecords, System.Data.IDbCommand command, System.Data.CommandBehavior behavior) (at <290425a50ff84a639f8c060e2d4530f6>:0)

System.Data.Common.DbDataAdapter.Fill (System.Data.DataTable dataTable) (at <290425a50ff84a639f8c060e2d4530f6>:0)

(wrapper remoting-invoke-with-check) System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable)

StockUpdate.ProcessUpdateTask (TextureContainer textureContainer, System.Collections.Generic.List`1[T] assignedShelfFaceDatas, Automation automation, UnionCoop.Core.data.Stock stock) (at <572a6c74c0474fd7ae89cf224552a56e>:0)

StockUpdate+<>c__DisplayClass10_4.<UpdateVirtualStoreAsync>b__6 () (at <572a6c74c0474fd7ae89cf224552a56e>:0)

System.Threading.Tasks.Task`1[TResult].InnerInvoke () (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Threading.Tasks.Task.Execute () (at <eae584ce26bc40229c1b1aa476bfa589>:0)

--- End of stack trace from previous location where exception was thrown ---

System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () (at <eae584ce26bc40229c1b1aa476bfa589>:0)

StockUpdate+<UpdateVirtualStoreAsync>d__10.MoveNext () (at <572a6c74c0474fd7ae89cf224552a56e>:0)

--- End of stack trace from previous location where exception was thrown ---

System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () (at <eae584ce26bc40229c1b1aa476bfa589>:0)

Automation+<UpdateVirtualStore>d__69.MoveNext () (at <572a6c74c0474fd7ae89cf224552a56e>:0)

--- End of stack trace from previous location where exception was thrown ---

System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <eae584ce26bc40229c1b1aa476bfa589>:0)

System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) (at <eae584ce26bc40229c1b1aa476bfa589>:0)

UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <85d1d3e7744a4a47b5f51883bf40bba2>:0)

UnityEngine.UnitySynchronizationContext:ExecuteTasks()
Posted
Comments
Dave Kreskowiak 6-Sep-23 23:03pm    
After 477 questions, you STILL can't comprehend you need to provide the code that's throwing the error. How is that possible?

1 solution

Dear Help Vampire: 30 seconds with Google will have told you what the error number means - it did me in less than ten.

And then you would have realized that it's not a problem we could even begin to help you with, since it's related to connecting to your DB and we have no idea what code you grabbed from the internet this time or what connection string it is trying to connect to a DB with, or where the actual DB it is trying to connect to might actually be.

Learn to start thinking. It really would help you considerably.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900