Friday, 15 July 2011

c# - INFORMATION_SCHEMA.TABLES like 'value' -



c# - INFORMATION_SCHEMA.TABLES like 'value' -

i'm confused sql query. have .sdf database tables created. have form checks see if table exists, creates new table, , fills total of info datagridview. can display of database tables in datagridview using select table_name information_schema.tables query, works, want show tables ending in '_quote'. how can 'filter' show tables ending in _quote? (for illustration table called random_table_name_quote). code far populating datagridview:

private void gettables() { datagridview1.datasource = dt; string strconnect = "data source=|datadirectory|\\lwadatabase.sdf"; using (sqlceconnection con = new sqlceconnection(strconnect)) { con.open(); using (sqlcecommand com = new sqlcecommand("select table_name information_schema.tables", con)) { using (sqlcedataadapter da = new sqlcedataadapter()) { da.selectcommand = com; da.fill(dt); datagridview1.columns[0].headercell.value = "quotation name"; } } } }

select table_name information_schema.tables table_name '%__quote'

c# sql datagridview sql-server-ce

No comments:

Post a Comment