Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (SqlCommand command = new SqlCommand(@"SELECT * FROM @table", connection))
- {
- command.Parameters.AddWithValue("@table", table_name);
- using (SqlDataReader reader = command.ExecuteReader())
- {
- while (reader.Read())
- ...
- }
- }
- using (SqlCommand command = new SqlCommand(string.Format(@"SELECT * FROM {0}",table_name), connection))
- {
- using (SqlDataReader reader = command.ExecuteReader())
- {
- while (reader.Read())
- ...
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement