Solved

Vb.net array

Posted on 2014-03-10
2
378 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
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 142

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

919 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

20 Experts available now in Live!

Get 1:1 Help Now