It may help to put some statements to echo the size of the hashtable before
and after to you write your data to the database. Compare them in debug and
release mode. Chances are, the issue is with some conditional logic and not
with the configuration build.
--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at
www.lulu.com/owc
--------------------------------------------------
"AD" <AD@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
Yes there are only 2 records in hash table. But it inserts 30-40 rows only
in
debug mode. If I run my application without debugging, it inserts 2 rows
exactly.
Do you know why this happens in debug mode ?
- Thanks Anand
"William F. Robertson, Jr." wrote:
You code looks correct. Are you sure there are only 2 records in hash
table? You probably have run this code several times. Are you clearing
your table before executing this code?
bill
"AD" <AD@discussions.microsoft.com> wrote in message
news:3B**********************************@microsof t.com... > Hi All
> I am using a hashtable and trying to insert rows into sqlserver
> database.
> My hashtable has 2 rows.
> My code is as follows:
> Dim myEnumerator As IDictionaryEnumerator = vh.GetEnumerator()
> While myEnumerator.MoveNext()
> SQL = "INSERT INTO Test(MyKey) VALUES ('" &
> myEnumerator.Key & "')"
> pmtCommand = New SqlCommand(SQL, pmtConn)
> pmtCommand.ExecuteNonQuery()
> End While
> When I check my table Test, there are more then 2 rows..there are
generally > 30-40 rows (duplicates). Any idea why?
> Thanks in advance.
> Anand