User1535942433 posted
Hi kafsar,
Accroding to your description,I suggest you could use getstring method to read the data.It will get the value of the specified column as a string.
More details,you could refer to below codes:
ASPX:
<table class="table-responsive" bordercolor="#000000" width="100%" height="Auto">
<tr bgcolor="#00CCFF" style="border-color: transparent">
<td width="200">Employee Name</td>
<td width="200">Department</td>
<td width="40">Status</td>
<td width="100">Last Activity</td>
</tr>
<%=empData()%>
</table>
Code-behind:
Public Function empData() As String
Dim Data As String = ""
Dim strS, strSql As String
strS = "Data Source=(localDb)\MSSQLLocalDB;Initial Catalog=aspnet-TestApplicationWithDatabase-20190820030542;Integrated Security=true"
Dim conn As SqlConnection = New SqlConnection(strS)
conn.Open()
strSql = "select * from People"
Dim sqlCommand As SqlCommand = New SqlCommand(strSql, conn)
Dim objRader As SqlDataReader = sqlCommand.ExecuteReader()
While objRader.Read()
Dim _name As String = objRader.GetString(0)
Dim _deptName As String = objRader.GetString(1)
Dim _sta As String = objRader.GetString(2)
Dim _stadate As String = objRader.GetString(3)
Data += "<tr><td><a href='2163656.aspx?ID='" & _name & "''>" & _name & "</a></td><td>" & _deptName & "</td><td>" & _sta & "</td><td>" & _stadate & "</td></tr>"
End While
conn.Close()
Return Data
End Function
Result:

More details,you could refer to below article:
https://stackoverflow.com/questions/13860490/show-data-in-asp-net-html-table
Best regards,
Yijing Sun