.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Error calling [Ten Most Expensive Products] using JDBC

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :


I've tried a million variations of "{ call [Ten Most Expensive Products] }" but I keep getting:

A server cursor cannot be opened on the given statement or statements. Use a default result set or client cursor.

Any idea why? All other Northwind stored procedures run fine.

thanks - dave

The future of B.I. - Raw & Uncut

View Complete Post

More Related Resource Links

syntax error in calling mailhelper class??


I use to program with VB.NEt. I am just learning C#.  I need to learn C# b/c I am a SharePoint developer and Admin and thats what SharePoint is coded from.


so I am trying to create a simple form that sends an email but am getting an error with calling this function:

       mailHelper.SendMailMessage("admin@pointeightpower.com", "jstevens@pointeightpower.com", null, null, "August Heat Stress", String.Concat(txtSupervisorName.Text.Trim, "reviewed this month's training on ", System.DateTime.Now));


it says param string has some invalid arguements. I dont know why. it works in VB.Net. any help? Thanks

Error calling WCF service that is returning list.".Debugging resource strings are unavailable ......

Ok.this is just making me frustrated... Here is step by step of what I am trying to do (& not able to) 1. I am calling WCF service hosted in a SharePoint 2010 site from a silverlight app in same domain (So no cross doman I guess). 2. I use Linq to Sharepoint for querying the DB. 3. I am having a list "machines" in Sharepoint 2010 that is having a lookup column from Other list called "part" 4. My WCF method GetAllMachines() works perfectly well when it skips the lookup column "partname" & returns List of type machineitem. 5. But problem occurs when I add machineitemobject.parts.partsname in my Linq to Sharepoint query . My service gives the error not found Async_ExceptionOccurred] Arguments: Debugging resource strings are unavailable." 6. Note that return type of my Method is List<machinesitem> 7. The point to note here is that I use SPMETAL tool to generate the LINQ class that maps the lists . So When I try to query the lookup column it tries to add List item of the type class & that is what causing the error. Is it because I am not using datacontract in my service (but it returns the strings & all private members of machines list e.g. name,title etc) Is it making the attribute Serialisable will solve the error ??? I am kind of lost in it ...Plss help!!   Thanks

Error calling sharepoint web services from .net 3.5 WCF client...

Code Snippet                 using (OCUserProfileService.UserProfileServiceSoapClient service =                     new TestAndDestroy.OCUserProfileService.UserProfileServiceSoapClient(GetWcfBinding())) {                     service.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;                                     PropertyData[] properties = service.GetUserProfileByName("domain\\user.name");                     foreach (PropertyData p in properties) {                        Console.WriteLine(p.Name);                        Console.WriteLine(p.Values);                    }       produces....The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://microsoft.com/webservices/SharePointPortalServer/UserProfileService:GetUserProfileByNameResponse. The InnerException message was 'Error in line 1 position 392. 'Element' 'IsPrivacyChanged' from namespace 'http://microsoft.com/webservices/SharePointPortalServer/UserProfileService' is not expected. Expecting element 'Name | Privacy'.'.  Please see InnerException for more details.   I'm totally stumped, any ideas???

Expression evaluation caused an overflow error when calling ExecuteResultSet(SqlServerCe.ResultSetOp

HelloWhen I call ExecuteResultSet(SqlServerCe.ResultSetOptions.Scrollable) I am getting the following error when the data type is Numeric(18, 4):Expression evaluation caused an overflow. [ Name of function (if known) =  ]The numbers involved are not that big and work fine when ExecuteReader() or ExecuteResultSet(SqlServerCe.ResultSetOptions.None) are called on the same SQL.Any ideas? Thanks in advance!Cheers,DaveCode:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click        Dim errorDescription As String = String.Empty        Dim numericNumber As String = String.Empty        Try            Using sqlCE As New System.Data.SqlServerCe.SqlCeConnection("Data Source = '" & My.Application.Info.DirectoryPath & "\MyDatabase.sdf';")                sqlCE.Open()                Dim sqlCECommand As SqlServerCe.SqlCeCommand = sqlCE.CreateCommand()                sqlCECommand.CommandText = "SELECT SUM(MT.TPM_Measure1) AS CurrentAmount FROM BUS_Table MT"                System.Diagnostics.Debug.WriteLine(sqlCECommand.CommandText)                Dim reader As System.Data.IDataReader = Nothing                If RadioButton1.Checked Then                    reader = sqlCECommand.ExecuteReader() 'Works fine                ElseIf RadioButton2.Checked Then                    reader = sqlCECommand.ExecuteRe

JDBC connection to SQLserver failing with ERROR [JDBCExceptionReporter] The connection is closed.

SQL server version: MS 2005 9.00.3050.00 Std edition Development version is on a stand alone server. Production is on an active/active cluster. Full error message below. There is an explanation and solution as noted below. However we do not see this issue in all our environments. Can anyone tell me why we see this issue in our production environment but not on our development environment, especially as the issue seems to arise following low usage times. Explanation / Solution If you are using the v1.2 driver, and you can positively rule out transient network connectivity issues and multithreaded usage, the next most common cause I am aware of is where a connection pool is being used and the pooling manager (e.g. DBCP or C3PO) does not test pooled connections for validity before handing them out to the app. What happens in this case is connections that sit idle in the pool for a very long time get closed by the TCP/IP stack, routing hardware, etc. Then they're already dead when the pooling manager hands them out. The solution is to configure the pooling manager to validate connections before handing them out, typically using a validation query like "SELECT 1". Error Message INFO | jvm 1 | 2010/09/07 07:52:11 | [09.07 07:52:11.396] LOG ERROR BROKO-EY-TBF-REDUCED-ENV-DP> INFO | jvm 1 | 2010/09/07 07:52:11 | - broko.quark.QueueMonitorThread.getNextCommand(QueueM

Why do I get a 401 error when calling a WCF service from a web part?

I have a SharePoint 2010 web part and WCF service deployed to a web application using Kerberos authentication. The service was developed based on the walkthrough from MSDN with the only difference that ClientCredentialType = HttpClientCredentialType.Windows so that Kerberos is used. The web application is being reverse-published through ISA. However we've never had an issue with this before. We've also disabled the loopback check on the server. When the web part calls the service, a 401 error occurs with the following exception message: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM'. I configured Fiddler on the web application running the web part and found that both Kerberos and NTLM authentication headers are being returned: HTTP/1.1 401 Unauthorized Server: Microsoft-IIS/7.5 SPRequestGuid: 541e724c-85a7-47a0-b045-827e1c50793c WWW-Authenticate: Negotiate oXsweaADCgEBoQsGCSqGSIL3EgECAqJlBGNgYQYJKoZIhvcSAQICAwB+UjBQoAMCAQWhAwIBHqQRGA8yMDEwMDkxNDA1MjY1NlqlBQIDDgespgMCASmpDBsKREVDUy5MT0NBTKoXMBWgAwIBAaEOMAwbCnNwX3dlYmFwcDE= WWW-Authenticate: NTLM X-Powered-By: ASP.NET MicrosoftSharePointTeamServices: Date: Tue, 14 Sep 2010 05:26:56 GMT Content-Length: 0 Proxy-Support: Session-Based-Authentication Why then is the Kerberos authentication not a

OPENQUERY Error when calling usp - object has no columns or the current user does not have permissio

Hi Guys, I need to get data using a usp, but getting error: Cannot process the object "EXEC BKS..uspPayments @paymentTypeCode1 = '1', @paymentTypeCode2 = '2', @paymentTypeCode3 = '3';". The OLE DB provider "SQLNCLI" for linked server "SERVER" indicates that either the object has no columns or the current user does not have permissions on that object. I am trying the script below: use myDB; select * from OPENQUERY([SERVER], 'EXEC myDB..uspPayments @paymentTypeCode1 = ''1'', @paymentTypeCode2 = ''2'', @paymentTypeCode3 = ''3''; ') Thanks in advance for any help. Everything is possible, impossible just takes longer

JavaScript Error while calling a drill through report in a report viewer from a asp.net web page.


I am calling a report in a web page which is getting displayed in report viewer. This report comes fine but when I click on it to see the drill through report for this parent report the drill through report does not get displayed and I see a JScript error instead.

The error I get is something like,

parent.document.GetElementByID(...).ClientController is not null or not an object

The aspx page that contains the report viewer inherits from a master page that contains an Update Panel.

I tested the report separately in SSRS and the drill through is working fine there.

Can some one please provide any inputs on this one?



Error calling a Oracle10g function from C#.net - HELP !


I have a function which can take 2 parameters and will return a string !

my function lokks like this,

Login(uname IN varchar2,inpass IN varchar2) return varchar2

The function absolutely works fine in isqlplus !

the problem is in the .cs file....

I'm using OracleHelper !

I dont know hoe to invoke the function from C# using Oraclehelper !

i'm posting my code anyways....

string s = OracleHelper.ExecuteScalar(connection,CommandType.StoredProcedure,"Login",
new OracleParameter("uname",TextBox1.Text),
new OracleParameter("inpass",TextBox2.Text)).ToString();


Error calling a WebRequest.Create() from within a Sharepoint webpart




I need to fetch data from a 3rd party URL (via a HTTP API call; different domain from where Sharepoint is hosted) to display inside a webpart. 

When I try to preview the webpart I get the following error:

Request for the permission of type 'System.Net.WebPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I've also added the following to my web.config. Tried with trust levels as WSS_Medium and Full with no avail.

Any ideas? The part of the code without the webrequest executes well.

error calling javascript in grid view template field


I am using a asp link button in grid template field which calls a pop up,i need to find the link button's control in cs page.

my link button code

<asp:LinkButton runat="server" ID="hlQName" Text='<%# Eval("QuestionnaireName")%>' OnClientClick

error calling javascript function in asp link button


I am using a asp link button in grid template field which calls a pop up,i need to find the link button's control in cs page.

my link button code

<asp:LinkButton runat="server" ID="hlQName" Text='<%# Eval("QuestionnaireName")%>' OnClientClick

Getting Error SECU1075: While calling webservice from C# DLL,WinForms



I have designed a console application as a web service client which is able to talk with webservice; however instead of console application if I design a WinForm or DLL of the same code I am getting following error message.

SECU1075: An error was discovered processing the <wsse:Security> header | System.Web.Services |    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)...

The only difference I figured out is, in case of DLL or WinForm it is creating an extra DLL with name <ProjectName>.XmlSerializers.dll which is not the case with Console application.

Anybody know what should I need to do to call the webservice from DLL instead of console application? Help appreciated

JDBC - calling stored procedure always returns 1 result set


I am running the following against Northwind on Sql Server 2005. It always returns a result set of 1 row regardless of the parameters passed:

Connection conn;
// not showing conn creation

CallableStatement callStmt = conn.prepareCall("{ call [Sales by Year] (?,?) });
callStmt.setDate(1, new Date (long_Jan_1_1996));
callStmt.setDate(2, new Date (long_Jan_1_1997));
ResultSet rs = callStmt.executeQuery();

Why do I only get 1 row of results back?

thanks - dave

Very funny video - What's your Metaphor?

Unable to cast COM object error when calling COM from .NET C# worker thread


I'm having an issue calling a COM object function from .NET C# client program. The COM object is written in C++ unmanaged. The problem only appears when I'm calling from a worker thread, it works fine if I call it from the UI thread. This is the error:

Unable to cast COM object of type 'gvAgileFileReaderLib.gvAgileFileReaderClass' to interface type 'gvAgileFileReaderLib.IgvMpiRead'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{616B5C39-C7FB-4C8C-85D4-27559DD83304}' failed due to the following error: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).

I have tried the following methods but all of them fails:

1) Create the COM object on UI thread, and call its function via its interface (IgvMpiRead) in the worker thread

2) Create the COM object on the worker thread & access its function from worker thread

3) Tried with worker thread set to STA & MTA

I need to use the COM function is a worker thread to prevent a long processing from holding up my UI, but it just doesn't work when I try to call the COM function inside the worker thread.

The weird thing is that doing the same from a unmanaged C++ client works fine (I can create the com object on UI, and then call its function from worker thread). Is this problem caused by inter

Protocol error (503 Service unavailable) when calling webservice from Win2003


I'm receiving a 503 Service unavailable -error from a webservice when calling client is on WinServer 2003.

Scenario: Windows Forms (.NET 4) application calls remote webservice on windows server 2003 to fetch information.
In some cases it takes a long time for the WebService to get the informationa (long running database procedure) so the client waits for the response.
WebService timeouts are set at +30min.

The setup has worked fine for some time now but recently we discored that a particular long running request began to fail.
The Windows Forms client fails with a 503: Service Unavailable -error and ProtocolError after just a couple of minutes into waiting for the response.

We did some testing and this error occurs if the client application is installed on a Windows Server 2003 box.
If we do the same test with the client application installed on a Windows 7 box it works without errors.

It seems that it has something to do with Windows 2003 but how to debug this?
Anyone have any ideas what could be the problem?


how to prevent an error event from propagating out to the agent job calling the package


I'm using an event handler to handle errors when certain control flow tasks fail.  If I can recover from the error, I set System::Propagate = false.  This appears to have the desired effect in that excution continues to the next task and the error was ignored.  The only problem is that when I launch my package through an SQL Server Agent Job, it reports that the job failed eventhough it really succeeded.  Is there anyway to prevent the error from progagating to the agent job? 

I've alternatively tried using failure precedence constraints and got the same results.

If the errors are handled, I want the job to finish execution with a success status.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend