Last few days I was doing some SQL connected with ASP.NET stuff and whole the time I was trying to avoid making a long queries and preffered to make two/three shorter. But now I have to make it in long query, but have no idea how.
I have two tables: person (idperson, name, surname) and visit (id, time, idperson) and what I want to do is to display on website with GridView time, name and surname of person, based on relations. Normal GridView puts time and idperson.
Simply I want to replace idperson in visit table with name and surname from person table. I know how to do that in SQL but when it comes to ASP.NET and GridView… I’m done.
In the SELECT Command of the SqlDataSource you should make a join. For example you can use the following:
I hope that this can help you.