I am working with C# and Asp.Net. I have following data adapter and Data set:
SqlDataAdapter da_Select_Matching_Records;
DataSet ds_for_showing_X_Rows_Cols = new DataSet();
I want to fill in the Data Set ds_for_showing_X_Rows_Cols with the query results. Here is my Code:
con = new SqlConnection("Data Source=local;Initial Catalog=Test;Integrated Security=True");
da_Select_Matching_Records = new SqlDataAdapter("Select BusinessSector5.Description_DE, SubCategory.Kategorie "+
"FROM Match_Subcategory_BusinessSector5 INNER JOIN "+
" SubCategory ON Match_Subcategory_BusinessSector5.SubCategoryID = SubCategory.ID INNER JOIN "+
" BusinessSector5 ON Match_Subcategory_BusinessSector5.BusinessSector5ID = BusinessSector5.ID", con);
//Filling of Data Set
da_Select_Matching_Records.Fill(ds_for_showing_X_Rows_Cols, "Description_DE, Kategorie");
I am getting this error, on the line where I am filling the data set. I used the query in Sql Server management studio and its running OK.
Incorrect syntax near the keyword INNER.