My Software : Comments and observations related to the usage and installation of softwares on my systems.
Updated: 2007-02-01; 08:49:33.

 

Subscribe to "My Software" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


Categories: (Check them too. My content isn't all on the main page)

Knowledge Management
Technology
My Hardware
My Software
En français!
Top 20 topics!


Currently reading:

The Second World War, Volume 1: The Gathering Storm by Winston S. Churchill

Beginning Linux Programming (Programmer to Programmer) by Richard Stones and Neil Matthew



www.blogwise.com

Male/31-35. Lives in Canada/Ontario/Ottawa/Manor Park, speaks French and English. Spends 80% of daytime online. Uses a Faster (1M+) connection. And likes Cooking/Reading.
This is my blogchalk:
Canada, Ontario, Ottawa, manor Park, French, English, Male, 31-35, Cooking, Reading.


The Political Compass: Economic Left/Right: -3.50
Authoritarian/ Libertarian:
-2.26


Technorati Profile
Popdex Citations



 
 

9 avril 2003


Running a stored procedure in a loop.

My two picks for the NCAA Finals came true. Let's see if Kansas wins tonight.

Okay, this bit of code iterates through a loop, running a stored procedure for each pass. The only item that differs from the normal use of a stored procedure is the line that reads objComm.Parameters.Clear(). Without this line, the parameters would continue to be added and not reset as they should be.

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
            ‘Db  declarations and such

            For i = intFirst To intLast
                    objParam = objComm.Parameters.Add("ID", OleDbType.Numeric, 7)
                    objParam.Direction = ParameterDirection.Input
                    objParam.Value = Session("ID")

                    objParam = objComm.Parameters.Add("strOne", OleDbType.Numeric, 7)
                    objParam.Direction = ParameterDirection.Input
                    objParam.Value = strOne

                    objParam = objComm.Parameters.Add("strTwo", OleDbType.Numeric, 7)
                    objParam.Direction = ParameterDirection.Input
                    objParam.Value = strTwo

                    objComm.ExecuteScalar()
                    objComm.Parameters.Clear()

                End If
            Next
    End Sub

[.NET Weblogs]
Very good trick to remember!

11:52:39 AM    comment []  - See Also:  .NET 

© Copyright 2007 Charles Nadeau.



Click here to visit the Radio UserLand website.
 



-->
April 2003
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Mar   May


Google
Search the whole web!
Search Charles radio!


www.flickr.com


Top 5 artists I listen to the most often during the last week:


I subscribe to:

Here's how this works.


Weather in Ottawa:
The WeatherPixie
Weather in Fukuoka:
The WeatherPixie