ADO.NET Beta1与Beta2对比
2024-07-10 13:03:30
供稿:网友
ado.net 1: namespaces and classes
microsoft has changed many things in its recent .net beta 2 release. most of the code compiled in beta 1 may not compile in beta 2. so if you are working on beta 1, you might want to upgrade it to beta 2. .net beta 2 sdk and vs.net beta 2 is available for download on microsoft's msdn site for msdn subscribers.
ado.net namespaces
in my first article, i'll discuss some of the ado.net changes. if you remember beta 1, there were two common namespaces - system.data.ado and system.data.sql. beta 1beta 2descriptionsystem.data.adosystem.data.oledbthis namespace contains database classes to work with ole db data sources.system.data.sqlsystem.data.sqlclientclasses to work with sql server 7.0 or later databases.
ado.net data components
besides the namespaces name changes, there are other changes such as data components. most of the data components remain same besides datasetcommand. in beta 2, datasetcommand component is replaced with dataadapters. dataadapters sits between a dataset and a database and fills data from the data source to the dataset. our following articles and sample code will show you how to work with dataadapters.beta 1beta 2descriptionadodatasetcommandoledbdataadapterthe filldataset method used to fill a dataset object from the adodatasetcommand, which is replaced with fill method of oledbdataadapter.sqldatasetcommandsqldataadapterthe filldataset method used to fill a dataset object from the sqldatasetcommand, which is replaced with fill method of sqldbdataadapter.
see my tutorial on dataadapters tutorial: working with oledb data adapters for how to write database applications using dataadapters.
dataset and dataview components remain same in beta 2. so that's all good since most of the programming revolves around dataset.
one more component changed in beta 2 is datasetview. datasetview is called dataviewmanager. i didn't look into the details of dataviewmanager but i'ld think no changes in that class.
connection and dataadapters
there is one big change in beta 2 is working with dataconnection and dataadapters. if you create dataadapter application, (see tutorial: working with oledb data adapters), there is no direct connection between data adapters and connection objects. in beta 1, you could connect a datasetcommand direct to a connection object.
in beta 2, you use datacommands to connect a connection object with the data adapters. there are four command objects for each insert, delete, update, and select sql queries.
there are more changes but i think its enough for today. its late and i better go get some sleep otherwise i won't be able to work tomorrow ;). may be, mike or i'll write more articles in more depth some other day. there are many other areas to be discussed. tomorrow, i 'll try to cover few xml.net areas. if you think you found something, which is different in beta 2 than beta1, just drop me a mail at [email protected] and help your fellow developers.
happy .neting ;).