Two database tables: 1)Client (ClientID, Name) 2)Purchase (ClientID, Name)
Situation: Login page --> online purchase page (Session with username)
Problem: How can i make the SQL over different tables? I want to insert Clientno in Purchase tables when clients make purchase.
Fail SQL: ( The session is okay )
string id = Convert.ToString(Session["UserID"]);
string query1 = "insert int Purchase ([Clientno]) values('"+@clientno+"') where [select Clientno where name ='"+id+"')";