Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Having trouble with textbox value updating

$
0
0

I'm using Visual Web Developer 2010 Express with SQL Server 2008 Express, VB.

I have a loop which contains a textbox.  I would like textbox1 to keep track of the inserts into the DB file as it loops through each row (value = X).  Instead, it seems to just give an updated total at the end of the loop.  All properties for the textbox are set at the initial default values.

        Z = 0
        For X = 1 To R Step 1
            querystring = "INSERT INTO [Capacitors] ([PART_NUMBER], [Part Type], [Description], [Value], [PCB Footprint], [Schematic Part], [Number of Pins], [Operating Temperature Maximum], [Operating Temperature Minimum], [Package Size], [Package Height], [Package Type], [Company Part Status], [Dielectric Type], [Equivalent Series Resistance], [Temperature Coefficient], [Tolerance], [Rated Voltage], [Implementation], [Implementation Type], [PSpiceTemplate], [Device Type], [UserField01], [UserField02], [UserField03], [UserField04], [UserField05], [UserField06], [UserField07], [UserField08], [UserField09], [UserField10], [TMP Manufacturer], [TMP Manufacturer PN], [Activeparts ID], [CLASS], [LP Viewer], [RowID]) VALUES("
            For Y = 0 To 37 Step 1
                querystring = querystring & "'" & idList(Z) & "'"
                If Y <> 37 Then querystring = querystring & ", "
                If Y = 37 Then querystring = querystring & ")"
                Z = Z + 1
            Next

            Using conn As New OleDbConnection(ConnString)
                Using cmd1 As New OleDbCommand(querystring, conn)
                    cmd1.CommandType = CommandType.Text
                    conn.Open()
                    cmd1.ExecuteNonQuery()  'Capacitors
                End Using
                conn.Close()
            End Using
            TextBox1.Text = X
        Next

Does anybody have any ideas/suggestions on how I can fix this?

Thanks!


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>