VB .NET experts

Dim IntNum As Integer

IintNum = 3


Console.WriteLine(String.Format("{0:000000}", fish))

*Jose C Gomez*
*Software Engineer*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>

*Quis custodiet ipsos custodes?*



On Thu, Apr 21, 2011 at 2:49 PM, Mark Wonsil <mark_wonsil@...> wrote:

>
>
> Michael wrote:
>
> > Dim Num As Integer =
> companyAdapter.CompanyData.Company.Rows(0)("Number02")
> > Dim format as string = "000000"
> > Dim numFormat As String = Num.ToString(format)
>
> That should work and is probably better in the .Net world. The
> zero-string-append hack was something that I had to use with VBA when
> doing Excel or Access coding.
>
> Mark W.
>
>
>


[Non-text portions of this message have been removed]
I have found a customization that will give me sequential number, but it doesn't
format the new number. I would want the number to be six numeric digits such as
000001, 000002, etc.

Looking at the MSDN site I thought I could do that in the ToString command, i.e.

if (found) then
nextKey = companyAdapter.CompanyData.Company.Rows(0)("Number02").toString("LT" +
"00000#")
companyAdapter.CompanyData.Company.Rows(0).BeginEdit()
companyAdapter.CompanyData.Company.Rows(0)("Number02") += 1

But this doesn't work. Any suggestions?
TIA -Karl

[Non-text portions of this message have been removed]
Use a shortchar field if you can..



Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Karl Dash
Sent: Thursday, April 21, 2011 10:56 AM
To: Vantage Group
Subject: [Vantage] VB .NET experts





I have found a customization that will give me sequential number, but it
doesn't
format the new number. I would want the number to be six numeric digits
such as
000001, 000002, etc.

Looking at the MSDN site I thought I could do that in the ToString
command, i.e.

if (found) then
nextKey =
companyAdapter.CompanyData.Company.Rows(0)("Number02").toString("LT" +
"00000#")
companyAdapter.CompanyData.Company.Rows(0).BeginEdit()
companyAdapter.CompanyData.Company.Rows(0)("Number02") += 1

But this doesn't work. Any suggestions?
TIA -Karl

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
Here is VB code that converts the number to string and then you set your length.
Str1+"i"→Str1
Otherwise use this code. This code creates two points for conversion and length.
:{0,1→L₁ :{0,N→L₂ :LinReg(ax+b) Y₁ :Equ►String(Y₁,Str1
:sub(Str1,1,length(Str1)-3→Str1

Michael Brown
Production Scheduler
Mobile: (715)896-1860




________________________________
From: Rob Bucek <rbucek@...>
To: vantage@yahoogroups.com
Sent: Thu, April 21, 2011 11:01:44 AM
Subject: RE: [Vantage] VB .NET experts

Â
Use a shortchar field if you can..

Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Karl Dash
Sent: Thursday, April 21, 2011 10:56 AM
To: Vantage Group
Subject: [Vantage] VB .NET experts

I have found a customization that will give me sequential number, but it
doesn't
format the new number. I would want the number to be six numeric digits
such as
000001, 000002, etc.

Looking at the MSDN site I thought I could do that in the ToString
command, i.e.

if (found) then
nextKey =
companyAdapter.CompanyData.Company.Rows(0)("Number02").toString("LT" +
"00000#")
companyAdapter.CompanyData.Company.Rows(0).BeginEdit()
companyAdapter.CompanyData.Company.Rows(0)("Number02") += 1

But this doesn't work. Any suggestions?
TIA -Karl

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]
Hi Karl,

> I have found a customization that will give me sequential number, but it doesn't
> format the new number. I would want the number to be six numeric digits such as
> 000001, 000002, etc.
...
> But this doesn't work. Any suggestions?

The cheesy (but effective) way to do this is to append your number to
a string of zeros and then take the right most characters:

Right("000000" +
companyAdapter.CompanyData.Company.Rows(0)("Number02").ToString(), 6)

Mark W.
Mark,
  Squeek, squeek! I LIKE cheese. Works great.
Thanks to all - Rob, Mike

-Karl


________________________________
From: Mark Wonsil <mark_wonsil@...>
To: vantage@yahoogroups.com
Sent: Thu, April 21, 2011 9:58:36 AM
Subject: Re: [Vantage] VB .NET experts

Â
Hi Karl,

> I have found a customization that will give me sequential number, but it
>doesn't
> format the new number. I would want the number to be six numeric digits such
as
> 000001, 000002, etc.
...
> But this doesn't work. Any suggestions?

The cheesy (but effective) way to do this is to append your number to
a string of zeros and then take the right most characters:

Right("000000" +
companyAdapter.CompanyData.Company.Rows(0)("Number02").ToString(), 6)

Mark W.



[Non-text portions of this message have been removed]
Try something lik this.
Dim Num As Integer = companyAdapter.CompanyData.Company.Rows(0)("Number02")
Dim format as string = "000000"
Dim numFormat As String = Num.ToString(format)

--- In vantage@yahoogroups.com, Mark Wonsil <mark_wonsil@...> wrote:
>
> Hi Karl,
>
> > I have found a customization that will give me sequential number, but it doesn't
> > format the new number. I would want the number to be six numeric digits such as
> > 000001, 000002, etc.
> ...
> > But this doesn't work. Any suggestions?
>
> The cheesy (but effective) way to do this is to append your number to
> a string of zeros and then take the right most characters:
>
> Right("000000" +
> companyAdapter.CompanyData.Company.Rows(0)("Number02").ToString(), 6)
>
> Mark W.
>
Michael wrote:

> Dim Num As Integer = companyAdapter.CompanyData.Company.Rows(0)("Number02")
> Dim format as string = "000000"
> Dim numFormat As String = Num.ToString(format)

That should work and is probably better in the .Net world. The
zero-string-append hack was something that I had to use with VBA when
doing Excel or Access coding.

Mark W.
Why not just use 'string.padleft' and parse it back to an int or whatever
you need.

int.parse(myString.padleft(6," "));

String.format will do it just as easily as well.

On Thu, Apr 21, 2011 at 2:49 PM, Mark Wonsil <mark_wonsil@...> wrote:

>
>
> Michael wrote:
>
> > Dim Num As Integer =
> companyAdapter.CompanyData.Company.Rows(0)("Number02")
> > Dim format as string = "000000"
> > Dim numFormat As String = Num.ToString(format)
>
> That should work and is probably better in the .Net world. The
> zero-string-append hack was something that I had to use with VBA when
> doing Excel or Access coding.
>
> Mark W.
>
>
>


[Non-text portions of this message have been removed]