G
Guest
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
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