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 7778379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:22:57+00:00 2026-06-01T18:22:57+00:00

The database I am using is SQL Anywhere from Sybase. v 11.0.1 I have

  • 0

The database I am using is SQL Anywhere from Sybase. v 11.0.1

I have the following stored procedure to insert a row. I
return the @@identity variable with a select statement.

ALTER PROCEDURE "DBA"."Portal_InsertHeader"( in
theimi integer, in theUser long varchar, in
theNextServiceDate date)
RESULT( ident integer )
BEGIN

insert into
InvoiceCreditHeader(imi,createdby,nextServiceDate)
values(theimi,theUser,theNextServiceDate);

select @@identity;

END

In my ASP.NET web app I have the following in the
SQLDataSource. I am using the output type in the last
parameter.

<asp:SqlDataSource ID="sqldsHeader" runat="server"
ConnectionString="<%$ ConnectionStrings:MSPortal %>"
ProviderName="<%$
ConnectionStrings:MSPortal.ProviderName %>"
InsertCommand="Call
Portal_InsertHeader(?,?,?)"
InsertCommandType="StoredProcedure">
<InsertParameters>
<asp:Parameter Name="IMI" Type="Int32" />
<asp:Parameter Name="USER" Type="String" />
<asp:Parameter Name="NextServiceDate"
Type="DateTime" />
<asp:Parameter direction="Output"
name="HeaderID" type="Int32" />
</InsertParameters>
<SelectParameters>
<asp:Parameter Name="ID" Type="Int32"
DefaultValue="0" />
</SelectParameters>
</asp:SqlDataSource>

When I call the .Insert method the row is inserted fine, but
when I try to check the Output parameter in the “Inserted”
method I get a null value.

So what do I need to change to get access to the output
variable in the ASP.NET code?

  • 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-06-01T18:22:58+00:00Added an answer on June 1, 2026 at 6:22 pm

    The solution was to use a parroter in the stored procedure with the inout keyword. Using just “out” didn’t seem to do it but all worked as expected when I changes it to “inout”

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

Sidebar

Related Questions

I have a method that deletes a row form a database using the sql
Any idea if it's possible to create a procedure in another database using T-SQL
I am using Sql database and I have indexed some tables. In some tables
We are using Sybase SQL Anywhere 11 . We need to encrypt some of
I'm tasked with exporting data from an old application that is using SQL Anywhere,
I have executed the following create statement using SQLWorkbench at my target postgresql database:
I have made a sql database using sql server. This database include images. When
I am connecting to an SQL database using a PLC, and need to return
I'm using ASP.NET 2.0 to connect to a Sybase SQL Anywhere 5 server. And
I imported data from MS-Access into a SQL database using the import/export wizard. Now,

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.