473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

fetching second row out put of stored procedure

I have Stored Procedure like this:
Expand|Select|Wrap|Line Numbers
  1. ALTER procedure [dbo].[carcallvalidation]
  2.     @carid nvarchar(100)=null
  3.     as 
  4.     begin
  5.     select t.TBarcode, t.Paid,t.Status,t.DelDate from Transaction_tbl t where TBarcode=@carid
  6.     declare @transid integer=null
  7.     select @transid= t1.transactID from Transaction_tbl t1 where TBarcode=@carid
  8.     select count(k.transactid) transid from KHanger_tbl k where k.transactid=@transid
  9.     end
while executing stored procedure i am getting out put like this:

Tbarcode paid status
1111 0 2

Transid
2

Return value
0
I Fetchd first row value like this:

Expand|Select|Wrap|Line Numbers
  1.     Dim cmdcarvalidation As New SqlCommand("carcallvalidation", con.connect)
  2.     cmdcarvalidation.CommandType = CommandType.StoredProcedure
  3.     cmdcarvalidation.Parameters.Add("@carid", SqlDbType.VarChar, 50, ParameterDirection.Input).Value = txtTicket.Text
  4.     dr = cmdcarvalidation.ExecuteReader
  5.     While dr.Read
  6.  
  7.         tbarcode=dr("Tbarcode")
  8.         payd= dr("paid")
  9.        status= dr("status")
  10.      end while
while fetching transid value like this am getting error,,,is there any way to fetch second row value
Jun 24 '13 #1
1 989
Killer42
8,435 Expert 8TB
Could you include details of the error please?
Jul 20 '13 #2

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

Similar topics

3
by: aaj | last post by:
SQL SERVER 2000 Hi all This is my first attempt at writing a stored procedure. I have managed to get it working but its unlikely to be the best way of handling the problem. While writing it I...
5
by: JS | last post by:
I have v8.1 fix 5 installed on windows 2k. I compiled a stored procedure in development environment, then used the get routine command to generate the file. I transferred the file to second test...
6
by: Terentius Neo | last post by:
Is it possible to combine (in DB2 UDB 8.1) a stored procedure and a select statement? I mean something like this: Select c.number, call procedure( c.number ) as list from table c With best...
3
by: Bilbo | last post by:
I have a a headscratcher here: I have a form that when submitted should do 2 things when a user enters data and then clicks the Add button. Here goes: 1. Call a stored procedure called...
0
by: franjorge | last post by:
Hi, I have created two stored procedures via VB using this code: sql = "CREATE PROC " & nombre_proc & " AS SELECT *" & _ " From MBM_PUNTOS_SCE_SIN_COINCIDIR_SIEGE_FALTA_PM_NE_" & mes & _ "...
1
by: deepdata | last post by:
Hi, I am trying to fetch data from db2 (express version) database by calling stored procedure. I have tried to use both cursor and for loop but still i am getting error. --======Start...
1
by: ILCSP | last post by:
Hello, I'm trying to accomplish 3 things with one stored procedure. I'm trying to search for a record in table X, use the outcome of that search to insert another record in table Y and then exec...
2
by: Bill_DBA | last post by:
I have the following stored procedure that is called from the source of a transformation in a DTS package. The first parameter turns on PRINT debug messages. The second, when equals 1, turns on the...
9
by: fniles | last post by:
I am using VB.NET 2003 and SQL2000 database. I have a stored procedure called "INSERT_INTO_MYTABLE" that accepts 1 parameter (varchar(10)) and returns the identity column value from that table....
0
by: gregoryday | last post by:
I am having a problem with creating a stored procedure. The premise underwhich we are operating is the following: We are working with two tables. The first table simply stores an integer value...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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,...
0
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...

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.