PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS 2005 [RESOLVED] Split string using asp.net 2.0 and ms access-VBForums
Results 1 to 3 of 3

Thread: [RESOLVED] Split string using asp.net 2.0 and ms access

  1. #1

    Thread Starter
    Hyperactive Member shyguyjeff's Avatar
    Join Date
    Jul 2007
    Location
    City of Durian
    Posts
    289

    Resolved [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?

    Thank you in advance everyone and have a nice day.
    Last edited by shyguyjeff; May 12th, 2009 at 05:23 AM.

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    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

  3. #3

    Thread Starter
    Hyperactive Member shyguyjeff's Avatar
    Join Date
    Jul 2007
    Location
    City of Durian
    Posts
    289

    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:
    1. Dim myString As String = "ABCDEFGHIJKL"
    2.         Dim myItem As ListViewItem
    3.  
    4.         For z As Integer = 0 To myString.Length - 1 Step 3
    5.             myItem = ListView1.Items.Add(myString.Substring(z, 3))
    6.             myItem.SubItems.Add("Brandname here")
    7.         Next

    After splitting the string I call the IN function in my SQL query. Thanks gep13 for the reminders.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width