TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
gaurav singh
NA
65
20.3k
Got Exception while Reading DB by WCF Service
Mar 12 2015 3:53 AM
Hi Dear,
I have face got so many times error, while reading data from Database using WCF service. Pl. any one suggest me. why this error has been raised many time.
Bellow line of code,we have got such excepiton
public Transaction Get(int TransactionID)
{
Transaction _transaction = new Transaction();
using (SqlConnection connection = new SqlConnection(DbConnectionSettings.ConnectionStringReadDatabase))
{
connection.Open();
try
{
using (IDataReader idr = SqlHelper.ExecuteReader(connection, "dbo.usp_DTTransactionGet", TransactionID, false))
if (idr.Read())
{
_transaction = AssignPropertyValues(idr);
}
}
catch (Exception ex)
{
Log.Exception("Exception in ServiceCore.DTTransaction.Get() ", ex);
}
}
return _transaction;
}
Exception in Repository.DTTransaction.Get(). TransactionId:
26397149Exception : System.Data.SqlClient.SqlException (0x80131904): Timeout
expired. The timeout period elapsed prior to completion of the operation or
the server is not responding. ---> System.ComponentModel.Win32Exception
(0x80004005): The wait operation timed out
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection, Action`1 wrapCloseInAction)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjec
t 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, String method,
TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean
asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, SqlTransaction transaction, CommandType commandType, String
commandText, SqlParameter[] commandParameters, SqlConnectionOwnership
connectionOwnership)
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, CommandType commandType, String commandText, SqlParameter[]
commandParameters)
at Repositories.TransactionRepository.Get(Int32 TransactionID) in
c:\Builds\127\FPServices\090.Finance.00Live.ADSProvider.Gated\Sources\02.Tea
ms\090.Finance\AdditionalServicesProvider\00.Live\DataAccessLayer\Transactio
n\TransactionRepository.cs:line 23
ClientConnectionId:eab68fcf-53e2-40ee-915d-5827167b7cb8
Reply
Answers (
2
)
Posting with multiple parameters to webapi using RestSharp
java client cant access wcf IIS Website folder