Hey, i require some help with a database. Ive tried to explain what im trying to do in the code section below.

Basically im trying to write an insert/search statement to the database. So far i have this.

Code:
objCommand.CommandText = "INSERT INTO ORDER1 (CardNumber, IPAddress, IpMatch) VALUES (@CardNumber, @IpAddress, @IpMatch);"
objCommand.Parameters.AddWithValue("@CardNumber", cardnumber.text)
objCommand.Parameters.AddWithValue("@IpAddress", ipaddress.text)
objCommand.Parameters.AddWithValue("@IpMatch", ipmatch.checked)
Basically i need to check the database first, to determine whether the creditcardnumber is UNIQUE with the IP address. If a CreditCard/IP exists and a different CreditCard number is used with the same IP addresses, IPMatch should be unchecked. So before i insert the data, i need to check that the Card Number is unique or uses the same IP address as previously used. See below for the table.

Code:
TABLE - [ORDER1]
													
CARDNUMBER       	--- 		IPADDRESS 		---			IPMATCH (CHECKBOX)
0000000000000000	---		1.1.1.1			--- 	  		checked
1111111111111111	--- 		1.1.1.1			---			unCHECKED
0000000000000000	---		1.1.1.1			---			checked
	
Check whether the 'CARDNUMBER' is unique for the 'IPADDRESS'
Only first Cardnumber is valid. 
IE if 0000... is used again, it will be CHECKED
Any other card number with that IP should be unchecked.
Hopefully you can understand what im trying to do.

Thanks for looking!