Visual Studio/IIS更改访问文件的表数据的顺序

时间:2023-01-28 20:20:34

I encountered weird problem when trying to use Access Database file in my project.

在我的项目中使用Access数据库文件时遇到了奇怪的问题。

I have a table named 'CarGears'. When I add some rows to it, Visual Studio shows them at the start of the table, instead of putting it at the button.

我有一张桌子叫“CarGears”。当我向它添加一些行时,Visual Studio在表的开头显示它们,而不是将它放在按钮上。

I am including pics of the problem Visual Studio/IIS更改访问文件的表数据的顺序

我正在把问题的图片包括在内

Visual Studio/IIS更改访问文件的表数据的顺序

Any solution for it?

任何解决方案吗?

Thanks

谢谢

1 个解决方案

#1


2  

Access is in fact sorting the table by the primary key, and thus is IS sorting the data every time.

访问实际上是按主键对表进行排序,因此每次都是对数据进行排序。

Most modern database systems consider all data un-ordered and you cannot assume order of data. The data is considered an un-ordered bucket of data. You can’t assume order since 5 users might be adding data, and now such order can’t be known since records can be added or removed by other users.

大多数现代数据库系统考虑所有数据的无序性,而不能假定数据的顺序。数据被认为是一组无序的数据。您不能假设order,因为5个用户可能正在添加数据,现在无法知道这个顺序,因为记录可以被其他用户添加或删除。

If you are using punched card computers, or reading a text file, you can assume order, but a database is not paper, not punched cards, and order of data can NEVER be assumed.

如果你使用穿孔卡片计算机,或者阅读文本文件,你可以假定顺序,但是数据库不是纸,不是穿孔卡片,而且数据的顺序是不能假定的。

Bottom line: If you want ordered data, then you query pull has to sort the data – any other assumption is NOT valid and cannot be assumed.

底线:如果您想要有序的数据,那么查询拉必须对数据进行排序——任何其他假设都是无效的,不能假设。

Access can sort 100,000 records with an index in about 1000th of a second or less – performance of such sorts is a non-issue, and even if it was, assumption of order cannot be assumed with a modern database system. This lesson and rule is usually the first day in any computer class that involves database theory.

访问可以对100,000个记录进行排序,在大约1000个秒或更少的情况下,这样的性能是一个不存在的问题,即使是这样,也不能假定一个现代数据库系统可以假定顺序。这一课和规则通常是任何涉及数据库理论的计算机类的第一天。

You are doomed in the use of computers and data processing if you ignore the above simple fact of computers and how database systems work.

如果您忽略了上述计算机的简单事实以及数据库系统的工作方式,那么您注定要使用计算机和数据处理。

#1


2  

Access is in fact sorting the table by the primary key, and thus is IS sorting the data every time.

访问实际上是按主键对表进行排序,因此每次都是对数据进行排序。

Most modern database systems consider all data un-ordered and you cannot assume order of data. The data is considered an un-ordered bucket of data. You can’t assume order since 5 users might be adding data, and now such order can’t be known since records can be added or removed by other users.

大多数现代数据库系统考虑所有数据的无序性,而不能假定数据的顺序。数据被认为是一组无序的数据。您不能假设order,因为5个用户可能正在添加数据,现在无法知道这个顺序,因为记录可以被其他用户添加或删除。

If you are using punched card computers, or reading a text file, you can assume order, but a database is not paper, not punched cards, and order of data can NEVER be assumed.

如果你使用穿孔卡片计算机,或者阅读文本文件,你可以假定顺序,但是数据库不是纸,不是穿孔卡片,而且数据的顺序是不能假定的。

Bottom line: If you want ordered data, then you query pull has to sort the data – any other assumption is NOT valid and cannot be assumed.

底线:如果您想要有序的数据,那么查询拉必须对数据进行排序——任何其他假设都是无效的,不能假设。

Access can sort 100,000 records with an index in about 1000th of a second or less – performance of such sorts is a non-issue, and even if it was, assumption of order cannot be assumed with a modern database system. This lesson and rule is usually the first day in any computer class that involves database theory.

访问可以对100,000个记录进行排序,在大约1000个秒或更少的情况下,这样的性能是一个不存在的问题,即使是这样,也不能假定一个现代数据库系统可以假定顺序。这一课和规则通常是任何涉及数据库理论的计算机类的第一天。

You are doomed in the use of computers and data processing if you ignore the above simple fact of computers and how database systems work.

如果您忽略了上述计算机的简单事实以及数据库系统的工作方式,那么您注定要使用计算机和数据处理。