Skip to content

Instantly share code, notes, and snippets.

public static DataTable GetComicBook(int comicBookId)
{
using (var conn = new SqlConnection(ConnectionString))
{
using (var cmd = new SqlCommand($@"
SELECT Id, SeriesId, IssueNumber,
[Description], PublishedOn, AverageRatng
FROM ComicBook
WHERE Id = {comicBookId};
", conn))
{
var dataAdapter = new SqlDataAdapter(cmd);
var dt = new DataTable();
dataAdapter.Fill(dt);
return dt;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment