using System.Data;
using System.Data.SqlClient;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ExampleWebsite.Pages;
public class Responses : PageModel
{
public void OnGet()
{
DataTable table = new DataTable();
const string connectionString = "secret";
using (SqlConnection connection = new SqlConnection(
connectionString )
)
using(SqlCommand cmd = new SqlCommand(
"SELECT * FROM Responses",
connection )
)
using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))
{
adapter.Fill(Dt);
}
}
}
using System.Data;
using System.Data.SqlClient;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ExampleWebsite.Pages;
public class Responses : PageModel
{
public void OnGet()
{
DataTable table = new DataTable();
const string connectionString = "secret";
using (SqlConnection connection = new SqlConnection(
connectionString )
)
using(SqlCommand cmd = new SqlCommand(
"SELECT * FROM Responses",
connection )
)
using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))
{
adapter.Fill(Dt);
}
}
}