Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with retrieving partial value from a column using VB.NET

Hi,

How do I modify the code below to retrieve the first 5 characters in SN?

For I = 0 to DataTable.Rows.Count - 1
countriesz &= "," & "'" & DataTable.Rows(I).Item("SN") & "'"
Next


Thanks,

Victor
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

If countriesz is the variable that is going to contain the first 5 then in Visual Basic Classic it would be
countriesz  = Left(DataTable.Rows(I).Item("SN"), 5)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor  Charles

ASKER

Thank You.