Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6575087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:20:39+00:00 2026-05-25T15:20:39+00:00

I’m running a program with an objectdatasource and a gridview. My Update method looks

  • 0

I’m running a program with an objectdatasource and a gridview. My Update method looks as if it’s passing through the program correctly. But when it gets to the DB, there’s some syntax error.

Here’s the stored proc

USE [starch]
GO
/****** Object:  StoredProcedure [dbo].[Starch_Update_KPCodes]    Script Date:       09/13/2011 11:02:1 ******/
SET ANSI_NULLS ON
 GO
SET QUOTED_IDENTIFIER ON
GO

ALTER procedure [dbo].[Stored_proc_name]
(
@bookcode as varchar(15),
@PC as varchar(10),
@EReader as varchar(10),
@Tablet as varchar(10),
@Mobile as varchar(10)
)
AS
Begin
Update storedproc
SET 
    Valid_Ans_Nbr = @PC 
where 
    kp_Column=82 and BookCode = @bookcode 
Update 
    Valid_Answers
SET
    Valid_Ans_Nbr = @EReader 
where 
    kp_Column=83 and BookCode = @bookcode


Update
    Valid_Answers
SET 
    Valid_Ans_Nbr = @Tablet 
where 
    kp_Column=84 and BookCode = @bookcode

Update
    alid_Answers
Set
    Valid_Ans_Nbr = @Mobile 
where 
    kp_Column=85 and BookCode = @bookcode

END

And then here’s what’s passed to the database in SQL profiler

exec sp_executesql N'Starch_Update_KPCodes',
                   N'@bookcode nvarchar(8),
                   @PC nvarchar(1),
                   @EReader nvarchar(1),
                   @Tablet nvarchar(1),
                   @Mobile nvarchar(1)',
                   @bookcode=N'A0027232',
                   @PC=N'1',
                   @EReader=N'1',
                   @Tablet=N'1',
                   @Mobile=N'1' 

Part of what I think is going on is that I’ve dropped and recreated the stored procedure a few times. And this line

N'@bookcode nvarchar(8),@PC nvarchar(1),@EReader nvarchar(1),
     @Tablet nvarchar(1),@Mobile nvarchar(1)'

probably pertains to some cached version of the stored proc.

I’ve checked my objectdatasource’s updating event to make sure it has the right paramaters.

How can I get rid of that extra text that is being passed to the stored procedure?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:20:40+00:00Added an answer on May 25, 2026 at 3:20 pm

    You presumably need to set the command type to stored procedure.

    Your existing code will just try and execute the bare statement Starch_Update_KPCodes and the parameters you pass in are unused anywhere in that statement.

    To do this via sp_executesql the statement would need to be

    exec sp_executesql N'EXEC Starch_Update_KPCodes 
                                 @bookcode=@bookcode, 
                                 @PC=@PC, 
                                 @EReader=@EReader, 
                                 @Tablet=@Tablet, 
                                 @Mobile=@Mobile',
                       N'@bookcode nvarchar(8),
                       @PC nvarchar(1),
                       @EReader nvarchar(1),
                       @Tablet nvarchar(1),
                       @Mobile nvarchar(1)',
                       @bookcode=N'A0027232',
                       @PC=N'1',
                       @EReader=N'1',
                       @Tablet=N'1',
                       @Mobile=N'1' 
    

    Which would be a bit silly compared to just calling the stored proc directly!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I need to clean up various Word 'smart' characters in user input, including but
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.