underlying connection was closed: The connection was closed unexpectedly

Hi ,

 

I am working with wcf and linq  and i am facing a problem"The underlying connection was closed: The connection was closed unexpectedly. " when i am trying to return my linq query to the client.I tried for changing the code in web.config for client and server.like

 

Client :

 

<behaviors>

<endpointBehaviors>

<behavior name="debuggingBehaviour">

<dataContractSerializer maxItemsInObjectGraph="2147483646" />

                           </behavior>

                     </endpointBehaviors>

              </behaviors>

<endpoint address="http://localhost/Host/Internal/myservice.svc" binding="basicHttpBinding"

                                    bindingConfiguration="BasicHttpBinding_IMyService" contract="LeadsServiceInternal.IMyService" name="BasicHttpBinding_IMyService"

                             behaviorConfiguration="debuggingBehaviour"

                                    />

 

Server :

 

<behavior name="MyService.ServiceImplementation.MyService_Behavior">

                                  <serviceDebug includeExceptionDetailInFaults="true" />

                                  <serviceMetadata httpGetEnabled="true" />

                                  <dataContractSerializer maxItemsInObjectGraph="2147483646"/>

                           </behavior>

                     </serviceBehaviors>

 

i want to bind the data to the grid which linq return as a query.

i am returning my linq query as in the method

public IQueryable GetGroupPermissions(string strGroupId, int appLevel, string strAclName)

{

var getGroupPermissionsQuery2 = from objGroup in objUser1

from objPrm in objUser2

where objGroup1.GROUP_ID.ToString() == strGroupId &&

objPrm.SYSTEM_DEFINED == 0 &&

objPrm.APPLICATION_LEVEL == appLevel

select new

{

objGroup.GROUP_NAME,

objPrm.PERMISSION_ID,

objPrm.PERMISSION_NAME

};

 

 

return getGroupPermissionsQuery.ToList();

}

 

i am binding it to my grid like

 

IQueryable objList =objSecurityService.GetGroupPermissions(strSelGroupId, 1, "echoApp").ToList();

Grid.DataSource = objList;

Grid.DataBind();

 

 

Please help me ..

 

Thanks,

Sk

0
krishnach
5/22/2008 5:22:43 AM
asp.net.object-datasource 16182 articles. 0 followers. Follow

0 Replies
1654 Views

Similar Articles

[PageSpeed] 56

Reply:

Similar Artilces:

Error occure while calling a WCF Service.(The underlying connection was closed: The connection was closed unexpectedly.)
  Hi,I am using WCF service in my application. when i call a method in the service. i get the following error- System.ServiceModel.CommunicationException: The underlying connection was closed: The connection was closed unexpectedly.Please Help!...

Connection.close() not closing my connection?
My servlet calls con.close() within the finally {} of a try..catch block. Yet I notice that sa_conn_info still lists the connection. Shouldn't the connection disappear from the sa_conn_info list when I close it? And if the answer to that is "yes, it should", has anybody seen situations like mine where it *doesn't* close it? Thanks for your help, Kathleen My bad... through a series of really stupid coding mistakes, I managed to cause a SQLException to be thrown from within the finally {} block before the connection could be closed... and I was ignoring the ...

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
  Hi I am using WebService in asp.net during webservices call an error occur some time. Which through the message like   The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. 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.Net.WebException: The underlying connection was closed: A connection that was expected to be kept aliv...

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server
Hello everyone, Please I truly need your help. I just changed my code from asp.net 1.1 to 2.0, and my page calls both the database and webservice for data. In asp.net 1.1, my code works perfectly, but in 2.0, I keep getting this error "Exception Details: System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." I spent weeks online and I got this code, Public Class MyTestServiceInherits VHMS.SOAPService Protected Overrides Function GetWebRequest(ByVal uri As Uri) As System.Net.WebRequestDim we...

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
Hi,  If anyone knows..... why would the above mentioned error occur?   It happens at this line of my code : iBranchHierarchyLevel = objdbAccess.org_GetBranchHierarchyLevel(iUserBranchID)   I am using a web reference - which is connected to objdbaccess and org_GetBranchHierarchyLevel is a method   tnx :) Follow this thread please http://forums.asp.net/t/1127234.aspx  Hosam Kamel Remember to click on Mark as answer on the post that helped you...

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server
Hi I am using WebService in asp.net during WebServices call an error occur some time. Which through the message like   The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. 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.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was ...

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server #2
Hi I am using WebService in asp.net during webservices call an error occur some time. Which through the message like   The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. Description: An unha...

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. (SOMETIMES)
This is an Asp.net page that gets info from a IBM Shadow web system. This works 100% for getting HTML but when a image is added an error sometimes occurs. (Could it be the amount of data transfered???). The error is : "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." This ONLY happens in .net 2.0 and NEVER in .net 1.1. I have searched but not found an applicable solution for this. Is there a property that needs to be set different?   [CODE]HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sRemoteURL); /...

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. (Alternate requests)
Hi Experts,   I am experiencing the The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. for alternate SOAP requests. Can any one help me in this.   I made default proxy settings in config file so but no luck.. <system.net>      <defaultProxy>         <proxy usesystemdefault ="false"            proxyaddress = "http://proxyserver:80"     ...

difference between connection.close and command.connection.close
hello, What is the difference between odbcconnection.close and odbccommand.connection.close? I am making connection once in my application in global.asax and opening connection at application_start event and closing it at application_end event. I am accessing connection through "global.myconnection" in webforms. NOw in the webforms,do I have to mycommand.connection.open before comand.executereader?? Does mycommand.connection.close , closes the odbcconnection that I make in gloabl.asax? It is confusing, because on the first function executing on webform, when I myc...

The underlying connection was closed: Unable to connect to the
Hi,I am using following to to check DNS is available or not.Try' similarly we can select any server address for bufData miningDim strURL As String = "http://www.directnic.com/whois/index.php?query=" + strDomainNameDim web As New WebClient' byte array to store the extracted bufData by webclientDim bufData As Byte()bufData = web.DownloadData(strURL)' got the bufData now convert it into string formfirstLevelbufData = Encoding.Default.GetString(bufData)' this exception will be fired when the host name is not resolved or any other connection problemCatch ex As System.Net.WebExceptionlblMes.Text =...

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send
I get this error intermittently while using a web service on my local machine.---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established conn...

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.
Hi,  I am getting this error System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. Everything works fine with ASP.NET WebServer but whn i Publish it on IIS 6 on Windows Server 2008, i stops and gives the above error, which is the case I need to handle. There are some posts for the same but didn't solve my problem like http://support.microsoft.com/kb/826210 http://chestermr.blogspot.com/2006/02/underlying-connection-was-closed.html All says to keep the alive connection property to false or extend it. But it is not working fo...

ystem.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive
 hi !! I am trying to copy a file from an ftp  . using WEbClient. Here is my sample code :try { string videoName= "DarkKnight.flv"; Uri uri = new Uri("ftp:/host/oflaDemo/streams/" + videoName);                 WebClient webcl = new WebClient();                 webcl.Credentials = (new NetworkCredential("ftpusername", "password"));          &n...

Web resources about - underlying connection was closed: The connection was closed unexpectedly - asp.net.object-datasource

Musica Viva review: Steven Isserlis and Connie Shih move into unexpectedly fierce territory
Belle Epoque compositions reflect complex synthesis of French sensibility and German form.

Italy's industrial production falls unexpectedly in July
Output of all products contracts, led by consumer goods sector. Italy's industrial production fell unexpectedly in July, as output of all products ...

Australian Drinking Team Unexpectedly Wins Cricket World Cup
The Australian Drinking Team has shocked the nation by unexpectedly winning the Cricket World Cup. Cricket has been the team's preferred hobby ...

Unemployment rate unexpectedly drops to 6 per cent
Australia's unemployment rate dropped from a revised 6.1 per cent to 6 per cent&nbsp;in May, as the economy absorbed an extra 42,000 workers,&nbsp;according ...

Canada’s inflation unexpectedly rises, food prices spike
Canada’s inflation rate unexpectedly quickened in June to the fastest in more than two years on higher food and clothing costs.

Economy shrank unexpectedly in November - CTV News
Canada's gross domestic product shrank unexpectedly in November, dragged down one-tenth of a percentage point largely on lower output in the ...

Consumers tapped out? Retail spending unexpectedly declines
Grappling with high debt levels, consumers have eased up on spending, according to the latest retail sales figures released on Wednesday.

Canada's Unemployment Rate At 6.8% As Economy Unexpectedly Adds Jobs
Canada's labour market surprised in March, churning out 29,000 new jobs, far exceeding economists' expectations of a decline of 10,000. But ...

Juno Award Winning Singer-songwriter John Bottomley Dies Unexpectedly at age50
TORONTO AND VANCOUVER , April 11 /CNW/ - John Bottomley , winner of the 1992 Juno award for most promising male vocalist, passed away on Wednesday ...

China's funds for foreign exchange drop unexpectedly
China's funds for foreign exchange drop unexpectedly People's Daily Online China's funds outstanding for foreign exchange fell unexpectedly ...

Resources last updated: 12/23/2015 1:51:10 PM