i have a django project that is connected to SQL Server i tried to retrieve data from the database.
if i try to display all the data it run correct and display all the values. but if i try to display the data in an **html table** it doesn't display anything. views.py ======= def connect(request): conn = pyodbc.connect( 'Driver={ODBC Driver 17 for SQL Server};' 'Server=DESKTOP-LPD1575\\SQLEXPRESS;' 'Database=testDB;' 'UID=test;' 'PWD=test;' ) cursor = conn.cursor() c = cursor.execute('SELECT * FROM Artist') return render (request,'connect.html',{"c":c}) connect.html ======== {% for row in c %} {{ row }} {% endfor %} this code in the html template work and display the data. but if i try to do as below it will not work <table align = "center"> <tr align="center"> <th>ID</th> <th>FolderNumber</th> <th>Title</th> </tr> {% for row in c %} <tr align="center"> <td>{{ row.id }}</td> <td>{{ row.artistName }}</td> <td>{{ row.activeFrom }}</td> </tr> {% endfor %} </table> anyone can help me? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f4760501-db2c-467d-8746-51fdcf9265f1%40googlegroups.com.