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


Top 5 Contributors of the Month
david stephan
Santhakumar Munuswamy
Asad Ali
Fauzul Azmi
Post New Web Links

Msg 137, Level 15, State 2, Procedure AddCMEXperience, Line 49 Must declare the scalar variable "@Re

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net
 

Hi folks, can someone please help me with this error?

Msg 102, Level 15, State 1, Procedure AddCMEXperience, Line 15
Incorrect syntax near ','.


Msg 137, Level 15, State 2, Procedure AddCMEXperience, Line 49
Must declare the scalar variable "@ReasonLeft".


Here is the Stored Procedure that is in question here

USE [ResponsedDatabase]
GO
/****** Object:  StoredProcedure [dbo].[AddNewEmployer]    Script Date: 10/03/2010 14:24:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[AddCMEXperience]
(
    @MemberID bigint,
    @EmployerID bigint,
    @DateStarted smalldatetime,
    @IsContinuing bit,
    @DateLeft smalldatetime,
    @PositionStarted nvarchar(50),
    @PositionLeft nvarchar(50),
    @StartingSalary nvarchar(20),
    @EndingSalary nvarchar(20),
    @TimeWorked float,
    @JobResponsibilities text,
    @ReasonLeft, nvarchar(200)
)

AS

INSERT CMExperience
(
    MemberID,
    EmployerID,
 &nbs


View Complete Post


More Related Resource Links

Msg 8152, Level 16, State 14, Procedure HAM_User_Productive_Time, Line 20 String or binary data woul

  

I have this procedure and table architecture - My ultimate moto is to check the User Start time and user end time and if user is logged in into 2 pcs at once then capturing the min start time and max end time . If user start time is greater than users previous end time then creating a new entry into table.

Alter

 

Procedure dbo.HAM_User_Productive_Time

As

BEGIN

Declare

 

@Min Datetime

Msg 50000, Level 16, State 1, Line 34

  

Hi,

I get the following error:

Msg 50000, Level 16, State 1, Line 34
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65669. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'capsqlextensions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)
System.IO.FileLoadException:
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Ass

Must Declare a Scalar Variable @ActName

  
It is a stored procedure and I am trying to qualify O.FullName using a parameter but I am getting error message "Must Declare a Scalar Vaiable @ActName" Not sure why No idea what is wrong on this. The parameter is correct as @ActName SELECT A.AccountID, A.AccountGID, AT.Name AS Type, M.MarketSegmentID, L.LeadSourceGID, O.EmployeeID, O.FullName AS Owner, CASE WHEN Adr.City IS NULL OR Adr.City = ' ' THEN 'BLANK CITY' ELSE Adr.City END AS City, CASE WHEN Adr.Country IS NULL OR Adr.Country = ' ' THEN 'BLANK COUNTRY' ELSE Adr.Country END AS Country, CASE WHEN Adr.StateProvince IS NULL OR Adr.StateProvince = ' ' THEN 'BLANK STATE' ELSE Adr.StateProvince END AS State, CASE WHEN Adr.AddressLine1 IS NULL OR Adr.AddressLine1 = ' ' THEN 'BLANK ADDRESS' ELSE Adr.AddressLine1 END AS Address1, CASE WHEN Adr.Postal IS NULL OR Adr.Postal = ' ' THEN 'BLANK POSTAL' ELSE Adr.Postal END AS Postcode, CASE WHEN A.Name IS NULL OR A.Name = ' ' THEN 'BLANK ACCOUNT NAME' ELSE A.Name END AS ActName, CASE WHEN A.PhoneNumber IS NULL OR A.PhoneNumber = ' ' THEN 'BLANK PHONE #' ELSE A.PhoneNumber END AS Phone, CASE WHEN SIC.Name IS NULL OR SIC.Name = ' ' THEN 'BLANK SIC CODE' ELSE SIC.Name END AS SIC, CASE WHEN M.Name IS NULL OR M.Name = ' ' THEN 'BLANK MKT SEG' ELSE M.Name END AS MktSeg, CASE WHEN A

Msg 10301, Level 16, State 1, Line 1

  
Hi, I am trying to register Excel that should be located at: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 in order to: CREATE ASSEMBLY Excel FROM 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Office.Interop.Excel.dll' But there is no: 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Office.Interop.Excel.dll' Where could I find that? Regards, Jos

Must declare the scalar variable "@NieuwsID".

  
Hallo, I get the error message:  Must declare the scalar variable "@NieuwsID". Can anybody help? <%@ Page Title="" Language="VB" MasterPageFile="~/Nieuws/MasterPageNieuws.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Nieuws_Default" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <link href="../Inloggen.js" type="text/javascript" /> <script type="text/javascript"> function toonPopUp() { var popUpPanel = document.getElementById('popUpPanel'); popUpPanel.style.display = 'block'; } function verbergenPopUp() { var popUpPanel = document.getElementById('popUpPanel'); popUpPanel.style.display = 'none'; } </script> <style type="text/css"> #popUpPanel { position: absolute; width: 200px; height: 200px; top: 80px; left: 400px; display: none; border: medium #2B8ED6 solid; padding: 5px; background-color: #FFFFFF; color: #333333; vertical-align: middle; } #xlogon { border-style:none; font-family: Verdana; font-size:medium; color: #2B8ED6; background-color: Transparent; } #logtekst { text-align:left; top: 20px; width: 190px; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="C

SQL Reporting Services 2005: Must declare scalar variable

  
I have a report that calls a stored procedure that builds a temp table and then runs a select that joins on that temp table. The only parameter I have is @Name, an optional parameter that can be filled or NULL.   I keep getting the error "An error has occurred during local report processing. An error has occurred during report processing. Query execution failed for data set. Must declare the scalar variable "@Name".   I have checked to make sure this parameter is connected to the dataset by looking at the parameter tab. I've searched on posts but haven't seen an answer. Does anyone have any idea what this could be about and how to fix it?

Gridview control Delete error -- Must declare the scalar variable "@GradeID"

  
 Hi All,Pardon me if this seems redundant. I have searched the archives and found many references to this type of error. Most (all?) boil down to a mismatch between the token for the databound field and the sql parameter. I have stared at this code for a long time and can see nothing wrong with it. In fact, it is so simple that I started over from scratch using only the designer (ie I wrote no code), so I don't see how it possible to have a name mismatch. I would very much appreciate any help figuring out what is the problem here. Thank you very much in advance.-Roger   Server Error in '/ssp/inet220a06' Application. Must declare the scalar variable "@GradeID". 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.Data.SqlClient.SqlException: Must declare the scalar variable "@GradeID". Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Msg 102, Level 15, State 1, Line 12 INCORRECT SYNTAX NEAR ')'

  
CREATE Table Item(
ItemID    numeric(18,2)  PRIMARY KEY,
VendorID   numeric(18,0)  NOT NULL,
ItemDescription  Char(50)   NULL,
PurchaseDate  DateTime   NOT NULL,
ItemCost   numeric(18,2)  NOT NULL,
ItemPrice   numeric(18,2)  NOT NULL,
 CONSTRAINT Item_FK FOREIGN KEY (VendorID)
  REFERENCES Vendor(VendorID)
  ON DELETE CASADE
  
);      <<<<HERE IS THE ERROR

Must declare the scalar variable "@UserId

  

I am receiving this error in my application :" Must declare the scalar variable "@UserId"."

 

Here is the code that generate the error:

 

<asp:SqlDataSource ID="categoriesDataSource"<

Error: Must declare the scalar variable - HELP!!

  

I have a textbox on my web page that allows the user to search for customers.  When they click on search, the following code below is running.  I am receiving the error message when trying to populate the data table.  Error Message says: Must declare the scalar variable "@SearchParms".


I tried re-testing and hardcoding '%oh%' in place of the @SearchParms and the query worked perfectly and posted the data back correctly.  I am racking my brain trying to figure out what I am doing wrong.  Can anyone help??


 string CustSearch = "'%'" + txtCustSearch.Text + "'%'";
        
        //Define query
        string sql = "SELECT CustomerID, FirstName, LastName, Email, City, State, Phone FROM dbo.Customer WHERE (FirstName LIKE '@SearchParms') OR (LastName LIKE '@SearchParms') OR (City LIKE '@SearchParms') OR (State LIKE '@SearchParms') ORDER BY LastName, FirstName";

        //Declare the Command
        SqlCommand cmd = new SqlCommand(sql, Conn);

        //Add the parameters needed for the SQL query
        cmd.Parameters.AddWithValue("

Must declare the scalar variable

  
Hello! I have a aspx page in which I have a Gidview populated by a sqlDataSouce.
This is my code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="CostEmployee1.aspx.vb" Inherits="RecursosHumanos_CostEmployee1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

Must declare the scalar variable "@Genre".

  

   protected void Button1_Click2(object sender, EventArgs e)
    {
        if (TextBox1.Text == "")
        {
            Label1.Text = "Your search opinion is empty, please try again";
        }
        else

Must declare the scalar variable "@memeberName".

  

I cant get this to work...

USE

 

yoga_studio

GO

IF

 

EXISTS (SELECT name FROM sys<

Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value when using JO

  

I am having a bit of time with a lab I am doing for school when I write the query this way there is no problems, it does what I want it to do. (I have tried to edit this to give the right formatting but it just is not working)

 

select

 employeeName
from

 employee
where

 employeeInitials in


(select

 employeeInitials
from

 service
where

 propertyId in


(select

 propertyID
from

 property
where

 propertyState = 'NY'

));

 

however, when I am answering the question to do that same query but using join instead of a sub I get an error.

 

select

 employeeName
from

 employee as

 emp join

 service as

 srv
on

 emp.employeeName = 

Another ERROR Message Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'COLUMN'

  

Ok, I would like to ask you this if I may,

On another database I created a table named FICTION

and the table looks like this:

CREATE TABLE FICTION
 (BOOK_CODE CHAR(4) PRIMARY KEY,
 TITLE CHAR(40),
 PUBLISHER_CODE CHAR(3),
 PRICE DECIMAL(4,2) );

Now I am trying to change the data type in TITLE to CHAR(50)

ALTER

 

TABLE FICTION

MODIFY

 

COLUMN TITLE

Msg 102, Level 15, State 1, Line 2 Incorrect syntax near 'MODIFY'

  
OK, TRYING TO UPDATE [MODIFY] AN EXISTING TABLE NONAPPLIANCE

HERE IS MY STATEMENT:

ALTER TABLE NONAPPLIANCE
MODIFY DESCRIPTION CHAR(30);

IT IS GIVING ME AN ERROR:

Msg 102, Level 15, State 1, Line 2 Incorrect syntax near 'MODIFY'.

WHAT AM I DOING WRONG?

Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'WHERE'.

  

Hi,

Recently received a trace file from customer of sql server which shows some errors in SQL statement but the front-end application is working fine.

I see SET FMTONLY ON and SET FMTONLYOFF and an additional WHERE clause. The statement looks like:

SET FMTONLY ON SELECT PLANCODE.SYSCODE, PLANCODE.CODE, PLANCODE.NAAM

Categories: 
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