@{ ViewData["Title"] = "Database Test"; }

Database Connection Test

@ViewBag.ConnectionStatus

@if (ViewBag.Error != null) {

Error: @ViewBag.Error

} @if (ViewBag.RecipeCount != null) {

Recipes in database: @ViewBag.RecipeCount

} @if (ViewBag.TableError != null) {

Table Error: @ViewBag.TableError

}
@if (ViewBag.Tables != null) {
Tables in Database 'recept'
@if (((List)ViewBag.Tables).Any()) {
    @foreach (var table in (List)ViewBag.Tables) {
  • @table @if (table.ToLower().Contains("recepie")) { Recipe Related }
  • }
} else {

No tables found in the database.

}
} @if (ViewBag.RecepieColumns != null) {
Structure of 'recepie' table
@foreach (var column in (List)ViewBag.RecepieColumns) { }
Column Name Data Type Nullable Key
@column.Name @column.Type @column.Nullable @column.Key
} @if (ViewBag.SampleData != null && ViewBag.ColumnNames != null) {
Sample Data from 'recepie' table
@foreach (var columnName in (List)ViewBag.ColumnNames) { } @foreach (var row in (List>)ViewBag.SampleData) { @foreach (var columnName in (List)ViewBag.ColumnNames) { } }
@columnName
@{ var value = row[columnName]?.ToString() ?? "NULL"; if (value.Length > 50) { value = value.Substring(0, 47) + "..."; } } @value
}
Back to Recipes