Click here to Skip to main content
15,912,204 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
C#
comm.CommandText = "SELECT sponcorid from Registration_Master WHERE regCode='" + temp + "'AND count_mem=" + count_mem + "";
comm.CommandType = CommandType.Text;
comm.ExecuteNonQuery();


and i want to update sponcorid how i use it
here is update query..

C#
comm.CommandText = "Update Registration_Master SET regCode='" + temp + "'AND count_mem=" + count_mem + "";

but what should i write in WHERE condition???
if sponcor is available for registration code(regCode) then sponcorid counter(count_mem) of that regCode should be updated
Posted
Updated 15-Nov-12 21:17pm
v2

1 solution

C#
comm.CommandText = string.Format("Update Registration set Regcode={0}, count_mem={1} where sponcorid={2}", temp, count_mem, sponcor_id);


In this query yout set the values for the sponcorid involved.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900