473,569 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Maintaining variable values

2 New Member
I have written a stored proc to write order details to the db. If there is additional description text, I am writting it out to another note table. i initially performed this using EXEC with another stored proc. When doing this, upon returning to my VB.Net app, the @Ordt_Id, @PDT_ProductSKU , and the @Pdt_ProdDesc variables no longer contain any data. I moved the note creation code into this stored proc, but I get the same results. If there is no note record created then the values are fine. How can i fix this?

CREATE Procedure usp_IMDetails_I nsertTempDtl
@Orht_Id int,
@Pdt_id int,
@Ordt_UOM varchar(10),
@Ordt_UnitsOrde red decimal(9,2),
@Ordt_Cost decimal(9,2),
@Ordt_Price decimal(9,2),
@Ordt_DiscountP ct decimal(9,2),
@Ordt_DiscountA mt decimal(9,2),
@Ordt_ExtendedA mt decimal(9,2),
@Ordt_AddDescTe xt varchar(50),
@CreatedBy varchar(50),
@Ordt_Id int output,
@Pdt_ProductSKU varchar(25) output,
@Pdt_ProdDesc varchar(60) output
AS

BEGIN

BEGIN TRANSACTION
INSERT INTO ordt_OrderDtl (
Orht_Id,
Pdt_Id,
Ordt_UOM,
Ordt_UnitsOrder ed,
Ordt_Cost,
Ordt_Price,
Ordt_DiscountPc t,
Ordt_DiscountAm t,
Ordt_ExtendedAm t,
Ordt_CreatedBy,
Ordt_CreatedDat e )
VALUES (
@Orht_Id,
@Pdt_Id,
@Ordt_UOM,
@Ordt_UnitsOrde red,
@Ordt_Cost,
@Ordt_Price,
@Ordt_DiscountP ct,
@Ordt_DiscountA mt,
@Ordt_ExtendedA mt,
@CreatedBy,
GETDATE() )

IF @@ERROR <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN -1
END

Set @Ordt_Id = @@Identity
Select @Pdt_ProductSKU = pdt_productsku, @Pdt_ProdDesc = pdt_proddesc
From pdt_product
Where pdt_Id = @Pdt_Id

IF LEN(@Ordt_AddDe scText) > 0
BEGIN
INSERT INTO nts_notes (
NTS_FileAssn,
NTS_ParTblId,
NTS_Type,
NTS_Text,
NTS_Destination ,
NTS_CreatedBy,
NTS_CreatedDate )
VALUES (
'Ordt',
@Ordt_Id,
1,
@Ordt_AddDescTe xt,
0,
@CreatedBy,
GETDATE())

IF @@ERROR <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN -2
END
END

COMMIT TRANSACTION
RETURN 1

END
GO
Jun 9 '06 #1
0 1400

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2247
by: leegold2 | last post by:
Probably a newbie question about "state": My problem is I have a search form, so user enters a keyword <enter>, then this form posts to another page were the result are displayed. But this display page uses pagination to break the results up into several subsequent pages. The 1st page is OK, but 2nd...last display pages loose the key word...
2
8912
by: Chip Mayan | last post by:
Hello, I am fairly new at stored procedures. I have created some that will go through a table and return a start date and an end date that is dependent upon the fiscal period you want, but I then need to use those dates in another stored procedure to retrieve the information I need. My stored procedure looks like this. ...
6
10608
by: M.Kamermans | last post by:
I have an XSLT script that has to operate on some particularly nasty XML to turn it into a SQL databse, but 'entries' in the XML aren't actually unique, so their unique identifier is useless. I need to somehow create crosslinked tables using the XSLT, but can only do this by maintaining a counter for each line I write. Is there a way to...
4
2022
by: lost hope | last post by:
hey guys, on the main page of my site, i have a login area (user/pass text boxes). when the user submits the form, the page is reloaded with with a global php variable "loggedIn" set to true. i also store the username and password in the page in a hidden form -- so that it can be passed to other pages on the site through standard navigation...
1
1824
by: Das | last post by:
Hi all, I'm using Asp.net. Within a form I have declared declared a public variable. When the form is loaded I set the property for the variable. but it doesn't maintain its state on postback. I there any way to maintain the state for variable? Thanks, Das
3
1215
by: MattC | last post by:
I have created a container class and instantiated it in one of my pages. I fill the object on page load when not on a postback. On a button click i want to do somethign with the values in that object, but on my button event being reached the object is now empty. private Visitor VisitorObj = new Visitor(); protected Label label1; ...
2
1989
by: Chris | last post by:
Hi, I am building a single webform/webpage asp.net application using VB.NET. I have created lots of classes for this web application. On page load I use a facade controller pattern class to perform all my initial class object instaniations using sub new() procedures I'm using this project to learn the ins and outs of OOA and OOD, so...
4
4321
by: Sam | last post by:
I have an asp.net 2.0 app that uses a sitemap, Master Page, and has several content pages. While this feature has simplified the process of creating a data-driven site menu, it does seem to have some big restrictions. Namely, maintaining state on the Master Page across all content pages. I simply want to keep track of a key value across all...
16
1849
rpnew
by: rpnew | last post by:
Hello friends.... I'm developing one project in PHP-MySql on FC4..... I'm facing a problem here at one place. Let me describe it.... I've one page in php on which i'm generating a table containing checkboxes for option. These options have suboptions. User need to chose these options and suboptions. with suboption they are getting textboxes in...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.