Solved

Vb.net array

Posted on 2014-03-10
2
397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 400 total points
ID: 39917300
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 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 100 total points
ID: 39917309
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

630 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