Click here to Skip to main content
16,004,833 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionConsole Application in VB6 Pin
Cmania12-Nov-06 20:13
Cmania12-Nov-06 20:13 
AnswerRe: Console Application in VB6 Pin
ChandraRam13-Nov-06 19:11
ChandraRam13-Nov-06 19:11 
QuestionHow to hide internet explorer menubar,toolbar,addressbar with VB.net code? Pin
TC2812-Nov-06 19:18
TC2812-Nov-06 19:18 
AnswerRe: How to hide internet explorer menubar,toolbar,addressbar with VB.net code? Pin
coolestCoder12-Nov-06 21:04
coolestCoder12-Nov-06 21:04 
GeneralRe: How to hide internet explorer menubar,toolbar,addressbar with VB.net code? Pin
TC2813-Nov-06 19:07
TC2813-Nov-06 19:07 
GeneralRe: How to hide internet explorer menubar,toolbar,addressbar with VB.net code? Pin
coolestCoder14-Nov-06 18:48
coolestCoder14-Nov-06 18:48 
QuestionHow to get status of the of the wave file [modified] Pin
BabuChellathurai12-Nov-06 18:45
BabuChellathurai12-Nov-06 18:45 
Questionsaving items from a checklistbox to a database Pin
steve_rm12-Nov-06 17:51
steve_rm12-Nov-06 17:51 
Hello,

I am using vb 2005 and sql server 2005, windows form.

I have a checkedlistbox that is populated from a database. See code below. I am wondering what is the best way to save the items that have been clicked to the database.
Private Sub loadGroups()<br />
        Dim objGetGroups As New BL_Groups()<br />
        Dim ds As New DataSet()<br />
        ds = objGetGroups.getAllGroups()<br />
        Dim dt As New DataTable()<br />
        Dim i As Integer<br />
        dt = ds.Tables(0)<br />
<br />
        Try<br />
            For i = 0 To ds.Tables(0).Rows.Count - 1<br />
                Me.chkLstSecurityRoles.Items.Add(dt.Rows(i).Item("Privilege")).ToString()<br />
            Next<br />
        Catch ex As Exception<br />
            MessageBox.Show(ex.Message)<br />
        End Try<br />
<br />
    End Sub<CODE><br />
Is it good to put them in to an array and them to a store procedure. <br />
<br />
If the user clicks 20 items, then I would have to do 20 inserts. That doesn't sound too efficient. <br />
<br />
The code I have for finding the checked items is below<br />
<CODE> Dim i As Integer<br />
        Dim strChecked As String<br />
<br />
        For i = 0 To Me.chkLstSecurityRoles.CheckedItems.Count - 1<br />
<br />
            strChecked = Me.chkLstSecurityRoles.CheckedItems(i).ToString()<br />
        Next


At the moment I am using seeing that the right items are correct, that is why i have a string value.

However, my problem is what is the best way to save this to a database. Any code examples would be grateful.

Thanks in advance,

Steve
QuestionHow Syncronize Outlook Address Book P2P via bluetooth Pin
pakning12-Nov-06 17:25
pakning12-Nov-06 17:25 
QuestionTextBox property Pin
andy3812-Nov-06 14:13
andy3812-Nov-06 14:13 
AnswerRe: TextBox property Pin
Christian Graus12-Nov-06 14:20
protectorChristian Graus12-Nov-06 14:20 
QuestionMIME Filter in .net Pin
venom0012-Nov-06 10:52
venom0012-Nov-06 10:52 
Questiontranslation from c#? Pin
ozeegers12-Nov-06 10:31
ozeegers12-Nov-06 10:31 
AnswerRe: translation from c#? Pin
Guffa12-Nov-06 10:51
Guffa12-Nov-06 10:51 
AnswerRe: translation from c#? Pin
Dave Doknjas12-Nov-06 12:34
Dave Doknjas12-Nov-06 12:34 
GeneralRe: translation from c#? Pin
ozeegers12-Nov-06 19:05
ozeegers12-Nov-06 19:05 
GeneralRe: translation from c#? Pin
ozeegers13-Nov-06 1:54
ozeegers13-Nov-06 1:54 
GeneralRe: translation from c#? Pin
ozeegers13-Nov-06 2:30
ozeegers13-Nov-06 2:30 
GeneralRe: translation from c#? Pin
Dave Doknjas13-Nov-06 4:08
Dave Doknjas13-Nov-06 4:08 
GeneralRe: translation from c#? Pin
ozeegers13-Nov-06 7:17
ozeegers13-Nov-06 7:17 
QuestionDatagrid help for newbie Pin
penguin500012-Nov-06 10:27
penguin500012-Nov-06 10:27 
QuestionHow to draw a spectral plot to a picturebox [modified] Pin
buzzztah12-Nov-06 9:39
buzzztah12-Nov-06 9:39 
AnswerRe: How to draw a spectral plot to a picturebox Pin
Christian Graus12-Nov-06 10:18
protectorChristian Graus12-Nov-06 10:18 
GeneralRe: How to draw a spectral plot to a picturebox Pin
buzzztah14-Nov-06 1:22
buzzztah14-Nov-06 1:22 
GeneralRe: How to draw a spectral plot to a picturebox Pin
Christian Graus14-Nov-06 9:41
protectorChristian Graus14-Nov-06 9:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.