Solved

Vb.net array

Posted on 2014-03-10
2
375 Views
Last Modified: 2014-03-10
I need declare an array something like this:
Dim arrayV() As String = {"Monitor", "DC Adapter", "Bag","Option1","Option2"}

But would like to store the contents of array in database field and then go get your content:

Database field content: "Monitor", "DC Adapter", "Bag","Option1","Option2"

And would get the contents of the field containing the array:

Dim ArrayV() as string={Database field content}

How can do
0
Comment
Question by:rflorencio
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 400 total points
Comment Utility
Assuming you are storing your values in a delimited format, you just need to use String.Split("<your delimiter>") to pull the values into an array:
'// Database access code

...

Dim arr() As String = SomeDataReader.GetString(0).Split("<your_delimiter>")

...

Open in new window

0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 100 total points
Comment Utility
just a note:
"Monitor", "DC Adapter", "Bag","Option1","Option2"

from the db should then be without all the quotes:
Monitor,DC Adapter,Bag,Option1,Option2
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now