[RESOLVED] Split string using asp.net 2.0 and ms access
Hello everyone.. I have a problem regarding splitting a string and that string has values on the table coming from ms access. Ex. I have "123456789" and it is coming from my database, how can i split that by 3 so that it will result into 123, 456 ,789 and that number has values on other tables but same fieldname. This is the following structure of my database.
Code:
First Table
Itemcode ItemName
123456789 Potato Chips
Second Table:
ItemCode BrandName
123 Mr.Chips
456 Lays
789 Cheetoos
This is what really i want, I need to get all those Brandname by getting the Itemcode on the first table and split it by three. Is there any query to make that or if it will be done using code, could anyone help me to get my problem solved? :confused:
Thank you in advance everyone and have a nice day.
Re: [RESOLVED] Split string using asp.net 2.0 and ms access
Hey,
I notice that you have now marked your thread as resolved without anyone posting a solution for you. If you have found the solution to your problem can you also post what you did you get there so that other people in the community can benefit from it?
Thanks
Gary
Re: [RESOLVED] Split string using asp.net 2.0 and ms access
Ahh i see..What I did to this is the following:
vb Code:
Dim myString As String = "ABCDEFGHIJKL"
Dim myItem As ListViewItem
For z As Integer = 0 To myString.Length - 1 Step 3
myItem = ListView1.Items.Add(myString.Substring(z, 3))
myItem.SubItems.Add("Brandname here")
Next
After splitting the string I call the IN function in my SQL query. Thanks gep13 for the reminders. :)