I have a python code that connect with sql server and retrieve the required data based on select query and display the result as a table with columns and rows.
The problem is that the retrieved data is displayed without columns name as shown in the picture below.
code:
import pandas as pd
import streamlit as st
st_input_update = st.number_input if is_numeric_dtype(all_columns) else st.text_input
search_term=st_input_update("Enter Search Term")
sql='select * from testDB.dbo.t1 where last LIKE ? '
param=f'%{search_term}%'
rows = cursor.execute(sql, param).fetchall()
st.dataframe(rows)
