简体   繁体   中英

how to create a temporary table from datagridview records in sql server 2005 from c#

i am working on winforms in C# .Net Framework 3.5.

i have a datagridview with some records, i want to create a temporary table with data of datagridview this control is not bound to any data table or dataset. user will manually enters record in it.

It sounds like you should be creating a View in SQL Server, which contains all records for all cities.

Then, you can create queries from your application (C#) which filter the table based on a single, selected City.

SQL Server provides caching of queries, so you will see a performance lift if the same city is queried multiple times.

The combination of your View and your query are, in essence, the 'temporary table' you are looking for. Be careful not to confuse this with SQL Server temporary table s or CTE 's.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM