Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smashdevcode/38d0e3ceaec20213e53c40ab9bf1c854 to your computer and use it in GitHub Desktop.
Save smashdevcode/38d0e3ceaec20213e53c40ab9bf1c854 to your computer and use it in GitHub Desktop.
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