I am using asp.net 2.0 with c#. I have two HashTable with values to be added inside my query. How do I add each value witth the correspoding key inside my query string.
Here is my two HashTable
Hash1.Add("1", "Bill");
Hash1.Add("2", "Micheal");
Hash2.Add("1", "Gates");
Hash2.Add("2", "Jackson");
Now here is what i have so far for the first HashTable
IDictionaryEnumerator enumerator1 = Hash1.GetEnumerator();
IDictionaryEnumerator enumerator2 = Hash2.GetEnumerator();
while (enumerator1.MoveNext())
{
string Value1 = enumerator1.Value.ToString();
cmd = new OracleCommand("Insert INTO MyTable FName, LName Values(Value1, Value2)", MyConn);
cmd.ExecuteNonQuery();
}
Base on what i have provided, am I doing the right thing? Basically when this query is run it should have two rows in my database. "Bill Gates" and "Micheal Jackson". How do i accomplish this task?
Don't forget to click "Mark as Answer" on the post that helped you.