.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

URGENT HELP NEEDED - RECEIVING ERROR MSG: Procedure or function usp_InsPatient has too many argument

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

error msg detail:

System.Data.SqlClient.SqlException was caught
  Message=Procedure or function usp_InsPatient has too many arguments specified.
  Source=.Net SqlClient Data Provider
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnSt

View Complete Post

More Related Resource Links

function error regarding Stored procedure


I have defined a boolean function with is supposed to trigger a stored procedure. 

However when stepping to the code, I am receiving an error that says " Procedure or Function 'proc_admin_updateTraining' expects parameter '@Pin_Code', which was not supplied."

However this parameter is supplied within my code. Any help will be greatly appreciated.

I have implemented a similar function 6 other times and it's working for those. This is the only one returning the error.

public bool updateTraining()

        int UpdatedRep = 0;
        SqlConnection sqlcon = new SqlConnection(connstring);
        SqlCommand sqlcom = new SqlCommand("proc_admin_updateTraining", sqlcon);
        SqlParameter ParPageID,ParWebLogin, ParPinCode, ParTrainerTelephone, ParTrainerName, ParTrainerContactEmail, ParOutlookApptBody, ParOutlookApptPriority,
        ParOutlookApptSubject, ParOutlookApptLocation, ParSendOutlookAppt;
        ParPageID = sqlcom.Parameters.Add("@web_site_page_id", SqlDbType.Int);
        ParWebLogin = sqlcom.Parameters.Add("@Web_Login", Microsoft.SqlServer.Management.Smo.SqlDataType.VarCharMax);
        ParPinCode = sqlcom.Pa

Content page control passes as argument to javascript function


Here is the content page:


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
   ouput.value = input.value;
   return true;
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>


I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

ERROR [S1000] [Microsoft][ODBC Visual FoxPro Driver]Function name is missing ).


I Am Continiously Getting Error For Following Line Of Code, It Work  Fine In Other Database

Am I Doing Any Mistake

if (sh3itno != "" && dpsh3no != "")
                string queryy = "SELECT [CHEQNO] FROM [SH3MAST] WHERE (([CHEQDATE] = " + chqdate + ") AND ([FAVOUR] = " + favour + ") AND ([CHQTYPE] = " + ctype + ") AND ([TRSTN] = " + trstn + ") AND ([TRBANK] = " + trbank + ") AND ([SH3ITNO] = " + sh3itno + ") AND ([DPSH3NO] = " + dpsh3no + "))";
                OdbcCommand cmd3 = new OdbcCommand(queryy, connen1);
                string chqno =cmd3.ExecuteScalar().ToString(); (Here Iam Getting Error)
                tbl.Rows[i]["cheque no"] = chqno;
Stack Trace: 

[OdbcException (0x80131937): ERROR [S1000] [Microsoft][ODBC Visual FoxPro Driver]Function name is missing ).]
   System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) +39
   System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, Strin

Error "The process cannot access the file ....." occurs while using function "ExportToStream"


Dear all,

   I sometimes get the following error while printing crystal report to pdf:

   System.Runtime.InteropServices.COMException (0x80004005): The process cannot access the file because
it is being used by another process. at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export
(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream
(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
 at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options) at
 CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType) at
 CommonWA.CommonFunc.GetPDFMemoryStream(DCMSReportDoc _dcmsreportdoc, Boolean& _DataExist) in E:\wwwroot\ASPWA\CommonWA\CommonCom.vb:line 382

  The error not occurs frequently but sometimes it will happen, can someone tell me why the error occurs and how can I solve the problem?

Thank you very much.


Error Executing CLR Stored Procedure "Item has already been added. Key in dictionary"

Hello, I'm consuming a web service through assemblies in a Sql Server 2005 database. The client was made with VB.net 2005. Everything was fine in the deploy phase but once I compile the assembly generated in my sql server database and try to execute the CLR stored procedure defined in the assembly it crashes throwing the following error: Error: There was an error generating the XML document. Inner Exception: Item has already been added. Key in dictionary: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Key being added: 'SqlCifin.InfoComercial.ParametrosConsultaDTO' Where SqlCifin is the name of the assembly, InfoComercial is the web reference namespace and ParametrosConsultaDTO is a complex type defined in the WSDL to encapsulate the request parameters. I tried almost everything but nothing seems to work: Already checked the enviroment variables and . I would appreciate any help you can provide me.  PD: I'm using WSE 3.0. Thanks, Andres Diab.

MDX - The function expects a tuple set expression for the 1 argument

I have a  scenerio dimension with several different scenerios. I am trying  subtract the measure values of the descendants in one scenerio to it's cousin in another scenerio. Here is my MDX query: WITH SET [actual - forecast] AS GENERATE( DESCENDANTS([Scenerio Dim].[Scenerio hierarchy].[actual], 0, SELF_AND_AFTER), { ( [Scenerio Dim].[Scenerio hierarchy].CURRENTMEMBER, [Measures].CURRENTMEMBER ) - ( COUSIN([Scenerio Dim].[Scenerio hierarchy].CURRENTMEMBER, [Scenerio Dim].[Scenerio hierarchy].[forecast baseline]), [Measures].CURRENTMEMBER ) } ) SELECT [actual - forecast] ON 0 FROM [actual vs forecast] I get the following error message: Query (4, 14) The function expects a tuple set expression for the 1 argument. A string or numeric expression was used.

"Format exception was unhandled by user" error. . .please help. . urgent!

Hi to all developers. I'm developing a survey site and i got this error 'Format exception was unhandled by user'. .  please help me deal with this. . any help is much appreciated. .here is where the error occured(2nd line):If Not Request.QueryString("DeptCode") Is Nothing Then            Dim DeptCode As Double = Double.Parse(Request.QueryString("DeptCode"))            Session.Add("DeptCode", DeptCode)        Else            Response.Redirect("default.aspx")        End Ifthanks in advanced. .

urgent help needed regarding transactional replication2005

urgent help needed regarding transactional replication2005   I did set up transactional replication on sql 2005 and also in article properties have selected to replicate foreign keys,default constraints and indexes. I checked the schema properties at publisher and subscriber and found that on one table a foreign key is not replicated which has an on delete cascade. I am not sure why is not replicating that constraint.The other table has a foreign key which is also not replicated.   I would appreciate all your help. thanks, Satya

"Out-of-Range" Error When Passing DateTime (DD/MM/YYYY) into Stored Procedure

Hi everybody, I hope some of you will be able to help me regarding this datetime problem. The query in the stored procedure doesn't accept DD/MM/YYYY format, although all dates are being saved in the format of DD/MM/YYYY hh:mm:ss. Example of query that throws the error: @sDate = '31/8/2010' @eDate = '1/9/2010' SELECT * FROM tb_Schedule where scheduledate >= @sDate and scheduledate <= @eDate  Error:  The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value FYI, the SQL Server 2005 is defaulted to British English(2057)for all logins and the DB server itself and my server Regional and Language is set to English (United Kingdom). Any help will be appreciated. Thank you very much.  

Cross Join and error Two sets specified in the function have different dimensionality.

WITH   SET   [InternetSET] AS {   CROSSJOIN ([APM Channel].[APM Channel Desc].&[Interactive] , {        [APM SubChannel].[APM Sub Channel Desc].&[Affiliates]       ,[APM SubChannel].[APM Sub Channel Desc].&[Partner]       ,[APM SubChannel].[APM Sub Channel Desc].&[Unreferred]       ,[APM SubChannel].[APM Sub Channel Desc].&[SMS]       ,[APM SubChannel].[APM Sub Channel Desc].&[Search]       ,[APM SubChannel].[APM Sub Channel Desc].&[Media]       ,[APM SubChannel].[APM Sub Channel Desc].&[E-mails] } ) }   SET   [Top1SET] AS {   TOPCOUNT([InternetSET],1,[Measures].[% Approve]) } MEMBER   [Top1]   AS   SUM([Top1SET],[Approved Apps]) / SUM([Top1SET],[Basic Apps]), Format_String='0.00%'   MEMBER   [Internet]   AS SUM([InternetSET],[Approved Apps]) / SUM([InternetSET],[Basic Apps]), Format_String='0.00%' select { // if I use the set below instead of the member below it I get // error : Two sets specified in the function have different dimensionality [Top1set] // if I use the member below instead of the set above the query works // but the name of the item is not dis

Allmembers function expects a hierarchy expression for the argument, a member expression is used" er

  Hi , I have a report that was working before.  After adding couple calculated mesaure, my report is throwing the error.  Here is the query I used.  Can you please help? this was a working prototype, now it is in trouble.  Need to fix it quickly.  thanks a million   SELECT NON EMPTY { [Measures].[sales], [Measures].[%of sales] } ON COLUMNS, NON EMPTY { ([region].[country].[country].ALLMEMBERS * [Fiscal Period].[Fiscal Year].[Fiscal Year].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [sales] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS      

create procedure [User_Name].sp_myprocedure. Error since I use dbo schema

I am developing with VS2010. When I generate a store procedure (DATASET>RIGHT CLICK ADD>SELECT>NEW STORE PROCEDURE) for a data table of a dataset from VS2010, the enviroment generates this: IF EXISTS (SELECT * FROM sysobjects WHERE name = 'SelectQuery' AND user_name(uid) = 'DOMAIN\USER-LOGIN')  DROP PROCEDURE [DOMAIN\USER-LOGIN'].SelectQuery GO CREATE PROCEDURE [DOMAIN\USER-LOGIN'].SelectQuery AS  SET NOCOUNT ON; SELECT contract_id, product_id, contract_description FROM dbo.TContracts GO The creation of the procedure ends with erros since my schema is dbo. So far, I work around copying and pasting the store procedure changing the schema and starting again from the beginning: DATASET>RIGHT CLICK ADD>SELECT>FROM EXISTING STORE PROCEDURE. Is there any way to configure VS2100 to generate the scripts avoinding to prefix the supposed schema of my user. Many thanks.

SharePoint Farm Backup Error in Search instance function

I'm working with MS Project Server 2007 with SharePoint WSS. When doing a full farm backup in SharePoint Central Admin > Operations > Backup and Restore > Perform a Backup, I encountered 2 errors in "SharePoint Windows Services Search, Search instance". 1) Error: Object a8b2cbfe-ef8b-45ce-92a0-c5675f534ec0 failed in event OnBackup. For more information, see the error log located in the backup directory.  InvalidOperationException: System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.SharePoint.Search.Administration.SPSearchBackupRestoreTimerJob.Execute(Guid targetInstanceId)   2) Error: Object a8b2cbfe-ef8b-45ce-92a0-c5675f534ec0 failed in event OnBackupComplete. For more information, see the error log located in the backup directory.  Object a8b2cbfe-ef8b-45ce-92a0-c5675f534ec0 failed in event OnBackup. For more information, see the error log located in the backup directory.  InvalidOperationException: System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.SharePoint.Search.Administration.SPSearchBackupRestoreTimerJob.Execute(Guid targetInstanceId)  InvalidOperationException: System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.SharePoint.Search.Administ

How to : Generic error handling function. Passing GridViewUpdatedEventArgs as EventArgs

Hi, I want to build a generic error handling function for handling inseted, updated, deleted events from formview, gridview and detail view. I am still a bit new to C# so I have encoutered a simple problem that I cannot resolve and cannot find an answer while searching google.Right now I handle error with validator for generic validation but I need to catch BLL error.I have different event handler for the different type of event : protected void FormView_AjoutCompte_ItemInserted(object sender, FormViewInsertedEventArgs e) { if (e.Exception != null) { Afficher_Erreur(e.Exception); e.ExceptionHandled = true; } } protected void GridView_ListeUtilisateurs_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { Afficher_Erreur(e.Exception); e.ExceptionHandled = true; } } protected void GridView_ListeUtilisateurs_RowDeleted(object sender, GridViewDeletedEventArgs e) { if (e.Exception != null) { Afficher_Erreur(e.Exception); e.ExceptionHandled = true; } } I want to create a generic function that will handle them all, a function such as : private void GestionDerreur(EventArgs e) { if (e.Exception != null) { Afficher_Erreur(e.Exception); e.Exc

Modifying Customizing EditForm.aspx of Doc lib breaks Upload function - Unknown Error

Part of a bigger design issue really. But does anybody know why customizing EditForm.aspx of a Doc lib breaks the Upload function? and how to fix it so it does not. My version of the editform works great, but after an upload I get Unknown Error the resulting url looks like this: https://xxxxx.edu/sites/xxxx/_layouts/Upload.aspx?List=%7b0404432B-91A3-4E18-9202-5954E3A7E0D2%7d&RootFolder=%2fsites%2fmcpharm%2ftest3&Source=https%3a%2f%2fxxxxx.edu%2fsites%2fmcpharm%2ftest3%2fForms%2fAllItems.aspx --- The bigger design issue - disregard if you like: That said, the bigger design issue is we are trying to relate one list row to many documents, but don't want to seperate the docs into seperate folders and would like the solutoin to be seamless. We are going to add a look up from the doc lib to the list, but did not want to use anythng but the List's ID column. However, we do not want users to have to manually look up List row IDs in that form, and we did not want to use a list column that can be edited, even if we can add a unique column policy. My design and thinking is to build a few custom pages with dataviews to show row level details in both lists (1 to many) and a dataview to drive list level functions like edit, delete and upload docs. I think all the pieces are there except for the less than graceful upload function that fist uploads the file and then asks the

How to use Store Procedure to execute the Function Of COM DLL (the DLL is Coded By C#)

Hi All, I find a question. How to use Store Procedure to execute the function of Dll? I tried as the steps: 1. Code a dll 2. Register the dll by "regasm XXX.dll /codebase" 3. Use the dll in SP But when I do it in step 3, I face some error, which is "Invalid class string" and the error ID is "0x800401F3" Could you help me solve this problem? Thank you very much.

Help needed on XPath Error: System.Xml.XPath.XPathException: Expression must evaluate to a node-set.

Im trying to determine if a value already exists in an XML file. In this case I want to know if there's a node "id" with value 3. But I cant figure out how...XML:<root><data><compare><locations><id>3</id><id>5</id></locations></compare></data></root>XSL:xmldoc.SelectSingleNode("//root/data/compare/locations/id=""3""")Error:XPath Error: System.Xml.XPath.XPathException: Expression must evaluate to a node-set.
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