View Complete Post
Hi folks, can someone please help me with this error?
Msg 102, Level 15, State 1, Procedure AddCMEXperience, Line 15Incorrect syntax near ','.
Msg 137, Level 15, State 2, Procedure AddCMEXperience, Line 49Must 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 ONGOSET QUOTED_IDENTIFIER ONGOCREATE 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))ASINSERT CMExperience( MemberID, EmployerID, &nbs
I am receiving this error in my application :" Must declare the scalar variable "@UserId"."
Here is the code that generate the error:
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 + "'%'";
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
<%@ 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"
I cant get this to work...
Can someone explain to me what I am doing wrong here. I have 2 textboxes "STDate" and "EDDate" and a button for downloading data to a csv file. However I keep on getting "Must declare scaler variable @STDate. I have configured the ControlParameter in the Select Parameter of the SQLDatasource so I'm a little confused why I keep on getting the line "Must declare scaler variable @StDate in my CSV File.
I'm pretty sure if it ever got past the 'declare scalar variable for @StDate it would throw an error for @EDDate. Luckly one I figure out what i'm doing wrong for the first one I can fix the second one.
Here is the ASP.net code:
<table style="width: 294%">
<td align="center" style="width: 1154px">
<asp:Label ID="Label1" runat="server" Text="Start Date"></asp:Label>
<asp:TextBox ID="STDate" runat="server"></asp:TextBox>
I am using an SQL datasource to update a table based on data passed by FCKEditor. My code is found below. The data loads in fckeditor fine, but when the save button is clicked, i get a Scalar Variable Exception, such is the following: