Advertisement

01.04.2008 at 02:03PM PST, ID: 23059934
[x]
Attachment Details

VB.Net 2005: Getting values from ListView.CheckedItems

Asked by k3n51mm in SQL Server 2005, Microsoft Visual Basic.Net, .Net Editors & IDEs

Tags: VB.Net 2005

The following code does not work, and I need to know why. All I want to do is get the .Text value of each ListViewItem in the ListView's CheckedItems and store it in a SQL CE database.

For Each lvItem As ListViewItem In lv.CheckedItems
                    Dim sb As New StringBuilder
                    sb.Append("INSERT INTO tbl1(Name, ID) VALUES('")
                    sb.Append(szCurrName)
                    sb.Append("', '")
                    sb.Append(lvItem.Text)
                    sb.Append("')")
                    cmdAdd.CommandText = sb.ToString
                    Try
                        cmdAdd.ExecuteNonQuery()
                    Catch sqlEx As SqlCeException
                    End Try
                Next

ThanksStart Free Trial
[+][-]01.04.2008 at 02:09PM PST, ID: 20586506

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.04.2008 at 02:30PM PST, ID: 20586619

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.05.2008 at 04:56PM PST, ID: 20591990

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.05.2008 at 07:40PM PST, ID: 20592401

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, Microsoft Visual Basic.Net, .Net Editors & IDEs
Tags: VB.Net 2005
Sign Up Now!
Solution Provided By: GreenGhost
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.05.2008 at 11:36PM PST, ID: 20593090

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628