A friend of mine has a problem, she has done a project in c# and everything looks fine, but the problem is that, she gets error with the SQL query when she puts it in the code, but when we try the code in microsoft SQL Server it works.
Here is thee example f the code where the error shows:
DataSet dsDelP = new DataSet();
string sql = "";
sql = "SELECT Grupi_ID, (p.emri + ' ' + p.mbiemri) as Profesori , k.EmriKlases as Klasa, d.emri as Dita, Ora_fillimit as Fillimi, Ora_mbarimit as Mbarimi";
sql += "FROM grupetOraret gro";
sql += "inner join Profesori p on gro.Profesori_ID=p.Profesor_ID";
sql += "inner join Klasa k on gro.Klasa_ID=k.Klasa_ID";
sql += "inner join Dita d on gro.ID_Dita=d.ID_dita";
SqlDataAdapter daDelP = new SqlDataAdapter(sql, con);
daDelP.Fill(dsDelP, "grupetOraret");
dataGridViewKerkoOrarin.DataSource = dsDelP.Tables[0].DefaultView;
You have no spaces. You should add them in every line (in its beggining or ending). This is how it should look like, assuming the query itself is correct (as soon as you checked it already):