473,395 Members | 2,798 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,395 software developers and data experts.

Why is the leading Zero Returned ?

Rob
In the code below, I am executing 2 stored procs that are returning row
counts.... I am storing a summary of the row counts into a Textbox... why,
when I am adding Salespeople (the first section of code) does it return a 0
before the text messages I have programmed ?

It returns the following to the Textbox when "Adding Salespeople"

0
Number of rows added to SalespersonMaster = 12

However, it just returns the row counts as follows with no leading 0 when
adding the Sales data ?
Number of rows added to SalesTrnDetail = 125
Number of rows added to CommissionDetail for Salesperson0 = 125....

Thanks !
__________________________________________________ ____________________-

cn.Open()
' Add Salespeople ----------------------------------------------
Dim cmds As New OleDbCommand
cmds = cn.CreateCommand()

cmds.CommandText = "sp_1"
cmds.CommandType = CommandType.StoredProcedure

cmds.Parameters.Add("@OutCntSalespersons", SqlDbType.Int).Direction
= ParameterDirection.Output

Dim drs As OleDbDataReader = cmds.ExecuteReader()
Do While drs.Read
txtMessages.AppendText(drs(0).ToString & ControlChars.CrLf)
Loop
drs.Close()

'Populate TextBox1 with Row Counts
txtMessages.AppendText("Number of rows added to SalespersonMaster =
" & cmds.Parameters("@OutCntSalespersons").Value.ToStr ing &
ControlChars.CrLf)
' End Add Salespeople ----------------------------------------------

' Add Sales Data --------------------------------------------------
Dim cmd As New OleDbCommand
cmd = cn.CreateCommand()

cmd.CommandText = "sp_2"
cmd.CommandType = CommandType.StoredProcedure

cmd.Parameters.Add("@OutCntSalesTrnDetail", SqlDbType.Int).Direction
= ParameterDirection.Output
cmd.Parameters.Add("@OutCntCommissionDetailSalespe rson0",
SqlDbType.Int).Direction = ParameterDirection.Output
cmd.Parameters.Add("@OutCntCommissionDetailSalespe rson1",
SqlDbType.Int).Direction = ParameterDirection.Output
cmd.Parameters.Add("@OutCntCommissionDetailSalespe rson2",
SqlDbType.Int).Direction = ParameterDirection.Output
cmd.Parameters.Add("@OutCntCommissionDetailSalespe rson3",
SqlDbType.Int).Direction = ParameterDirection.Output

Dim dr As OleDbDataReader = cmd.ExecuteReader()
Do While dr.Read
txtMessages.AppendText(dr(0).ToString & ControlChars.CrLf)
Loop
dr.Close()

'Populate TextBox1 with Row Counts
txtMessages.AppendText("Number of rows added to SalesTrnDetail = " &
cmd.Parameters("@OutCntSalesTrnDetail").Value.ToSt ring & ControlChars.CrLf)
txtMessages.AppendText("Number of rows added to CommissionDetail for
Salesperson0 = " &
cmd.Parameters("@OutCntCommissionDetailSalesperson 0").Value.ToString &
ControlChars.CrLf)
txtMessages.AppendText("Number of rows added to CommissionDetail for
Salesperson1 = " &
cmd.Parameters("@OutCntCommissionDetailSalesperson 1").Value.ToString &
ControlChars.CrLf)
txtMessages.AppendText("Number of rows added to CommissionDetail for
Salesperson2 = " &
cmd.Parameters("@OutCntCommissionDetailSalesperson 2").Value.ToString &
ControlChars.CrLf)
txtMessages.AppendText("Number of rows added to CommissionDetail for
Salesperson3 = " &
cmd.Parameters("@OutCntCommissionDetailSalesperson 3").Value.ToString &
ControlChars.CrLf)
'End Add Sales
Data --------------------------------------------------

cn.Close()
Nov 21 '05 #1
0 889

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: david | last post by:
Hi, I have an application as follows: MySQL database Back-Eend linked to MS Access Front-End and ASP Web Application. I require users to enter Serial Numbers such as: 0105123567 (10...
2
by: Jeff Lowry | last post by:
I'm pasing a zip code as a prameter to an Access stored procedure. In Access the parameter is a text data type. It works for non-leading zero zip codes but, apparently access (or ASP) is...
7
by: david | last post by:
Hi, I have 2 text boxes on an ASP form. A user enters a Serial Number in TB1 such as 0105123456, presses tab to move to TB2, TB2 then displays the value of TB1 after a calculation has been...
1
by: Joshua Ammann | last post by:
Hello, I'm trying to export a query containing contact information, including a field. Some zip codes have one or two leading zeros, for example, San Juan, PR (00927) and Springfield, MA...
2
by: chris | last post by:
Hi, I have a simple ms access application that allows you to scan barcodes in to a form which stores them in the database. The barcodes are 6 digits in length e.g. 555666 but my handheld...
5
by: GarryJones | last post by:
I have code numbers in 2 fields from a table which correspond to month and date. (Month, Code number) Field name = ml_mna 1 2 3 etc up to 12 (Data is entered without a leading zero)
8
by: Andrew Poulos | last post by:
In my limited testing with FF 2, IE 6 and Opera 9 when I divided a positive integer, that is less than 100, by 100 I get a leading zero in front of the decimal point. For example 80/100 gives...
4
by: bobm2005 | last post by:
Whatever format I try in Printf, an 'E' format number nearly always has a leading non-zero:- 1.2345E7 -9.3456E8 etc. Is it possible to force it (printf) always to have leading zero? ...
1
by: Monte Cristo | last post by:
Hi all, I'm having a problem with results being returned from a data source, it's returning the right value but without the zero's "0" in front. I've searched through google for "padding zero's in...
6
by: JimmyKoolPantz | last post by:
Task: Customer wants a script of the data that was processed in a "CSV" file. Problem: Zip-Code leading zeros are dropped Basically we have a client that has requested a custom script for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
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...

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.