Created
February 26, 2018 08:04
-
-
Save talkingdotnet/d843f274aaf749dc0d1704d6e0fba9e9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private DataTable GetTableList() | |
{ | |
DataTable dt; | |
string sQuery = @"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'"; | |
using (SqlConnection conn = new SqlConnection(_connectionString)) | |
{ | |
using (SqlCommand command = new SqlCommand(sQuery, conn)) | |
{ | |
conn.Open(); | |
DataAdapter da = new SqlDataAdapter(command); | |
DataSet ds = new DataSet(); | |
da.Fill(ds); | |
dt = ds.Tables[0]; | |
} | |
} | |
return dt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment