Solved

SQL UPDATE with VB.Net SUBSTRINGS

Posted on 2011-03-11
2
246 Views
Last Modified: 2012-08-13
Hello Experts,

I'm wanting to UPDATE the Sequence field in a SQL Server 2008 table by using the Index of a listbox +1. I want to use the first characters in the strings that populate the listbox as the JOIN criteria. Something like :
"UPDATE tblQuestionnaire SET Sequence = '" & intSeq & "'" & _
                    "WHERE Q_Key = '" & intQ_Key & "'"
Except as a loop through all the records selected in the listbox (lbQuestions) and intQ_Key as the first characters.
The strings in the listbox are like:
385, Does yada yada yada?
257, Is yada yada yada?
1564, Can it yada yada yada?

So I need a way to grab the numbers to the left of the comma. Any ideas?

Thanks in advance,

JackW9653



0
Comment
Question by:JackW9653
[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 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 35113619
To get the numbers to the left of the comma, you can use the String.Split function....

    intQ_Key = lbQuestions.Items(intSeq).ToString.Split(","c)(0)

Open in new window


Wayne
0
 

Author Closing Comment

by:JackW9653
ID: 35113771
Thank you very much.
JackW9653
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

691 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