Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (var conn = new SqlConnection(Constants.LOCAL))
- {
- using (var cmd = new SqlCommand())
- {
- cmd.Connection = conn;
- cmd.CommandType = CommandType.Text;
- cmd.CommandText = Constants.QUERY_HTML;
- conn.Open();
- DataTable dt = new DataTable();
- try
- {
- using (var reader = cmd.ExecuteReader())
- {
- dt.Load(reader);
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.ToString());
- }
- if (dt.Rows.Count > 0)
- {
- result.payload = dt;
- result.hasPayload = true;
- result.code = 200;
- }
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement