Created
July 10, 2017 19:17
-
-
Save smashdevcode/38d0e3ceaec20213e53c40ab9bf1c854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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