Hi guys
I want to join two tables and executive the sql statement.I mention what is code i wrote ,Once Complie the code it says Error1 The left-hand side of an assignment must be a variable, property or indexer
SqlConnection Con3 = new SqlConnection("Data Source=IT;Initial Catalog=Test;Integrated Security=True"); Con3.Open(); string str1 = "Select * from dbo.Executive "; string str2 = "select * from Retailer"; SqlDataAdapter adpter = new SqlDataAdapter(str1,Con3); SqlDataAdapter adpter1=new SqlDataAdapter(str2,Con3); DataTable Executive = new DataTable(); DataTable Retailer =new DataTable(); adpter.Fill(Executive); adpter1.Fill(Retailer); // MessageBox.Show(Retailer.Rows.Count.ToString()); DataTable table1 = new DataTable(); string str4 = "select b.SalesExecutiveCode,ExecutiveName from" + Executive + " inner join" + "(" + "select SalesExecutiveCode from" + Retailer + "where RetailerCode='00000949'" + ")" + "as"+table1+" on" + Executive.Columns["ExecutiveCode"] = table1.Columns["SalesExecutiveCode"];In above coding I create the datatable and I used it as alias when i join the two tables.But i think no data in that data,Pls tell me what is wrong in this coding
Thanks
hi
y r u dumping all this in str4. for ur identification, store first select query in 1 var and second query in 2 variable and check the condition . i think problem in after "as"