solved this error Incorrect syntax near the keyword 'INNER'.

Jun 23 2015 3:42 AM
i want to update two table using one sql server statement and one update button .
but when i am run my code a error will be occur and that is
 
error:Incorrect syntax near the keyword 'INNER'. 
my code is bellow .
 
SqlCommand cmd = new SqlCommand("UPDATE profilesrr INNER JOIN call_detailssr ON profilesrr.id = call_detailessr.profilesrr_id SET profilesrr.phone_number = '+ textpnumber.Text +', profilesrr.title = ' + texttitle.Text +',profilesrr.first_name = '+ textfname.Text +',profilesrr.middle_initial = '+ textmname.Text +',profilesrr.last_name = '+ textlname.Text +',profilesrr.address = '+ textadd.Text +',profilesrr.city = '+ textcity.Text +',profilesrr.state = '+ textstate.Text +',profilesrr.province = '+ textprovince.Text +',profilesrr.postal_code = '+ textpcode.Text +',profilesrr.country_code = '+ textccode.Text +',call_detailssr.call_in_date = '+ textcdate.Text +',call_detailssr.call_duration = '+ textcduration.Text +',call_detailssr.call_status = '+ textcstatus.Text +',WHERE profilesrr.id = 1", conn);
cmd.ExecuteNonQuery();
 
 
please help me
thanks in advance 
 
 

Answers (21)