Hello experts,
I have a table named "products" which has two columns named 'product_name' and 'quantity' ....
So i need an INSERT query to insert entry into this table without duplicate error...
I mean:
Code for inserting a data into table :
So..lets think i have inserted one product to the table :
So now i want another product with the same name..and yes i want exactly that same entries in same table....
And i stuck that it occurs an error called "found duplicate productname"
i can IGNORE this error by querying like :
But by this query i can solve that error but it will not insert the same item in the table....
SO please help me how to allow duplicate entries into a table...
Thanks in advance....
I have a table named "products" which has two columns named 'product_name' and 'quantity' ....
So i need an INSERT query to insert entry into this table without duplicate error...
I mean:
Code for inserting a data into table :
Code:
ds = New DataSet
da = New MySqlDataAdapter("INSERT INTO products (product_name, quantity) VALUES('" & tbxProdname.Text & "', '" & Val(tbxQuantity.Text) & "')", conn)
da.Fill(ds, "products")product_name ------------- quantity
Hair Color --------------------- 100 piece
Hair Color --------------------- 100 piece
So now i want another product with the same name..and yes i want exactly that same entries in same table....
And i stuck that it occurs an error called "found duplicate productname"
i can IGNORE this error by querying like :
Code:
"INSERT IGNORE INTO products (product_name, quantity) VALUES('" & tbxProdname.Text & "', '" & Val(tbxQuantity.Text) & "')SO please help me how to allow duplicate entries into a table...
Thanks in advance....