I wrote an application to mvc 4. I need to report on the specified parameters displayed in a separate tab rather than the current page. Can anybody help me? This is parts of my code
View:
<table border="1">
<thead>
<tr>
<th>C1</th>
<th>C2</th>
<th>C3</th>
</tr>
</thead>
<tbody>
@foreach (DataRow row in Model.Rows)
{
<tr>
@foreach (DataColumn col in Model.Columns)
{
<td>@row[col.ColumnName]</td>
}
</tr>
}
</tbody>
</table>
}
</div>
Controller:
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand cmd = new SqlCommand(commandText, connection);
connection.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
DataTable myTable = new DataTable();
myTable.Load(reader);
return View(myTable);
}
}