随笔分类 - ado.net
1
摘要:The DataContext object manages object identity for you so that rows retrieved from the database table are automatically logged in the DataContext object’s internal identity table by the row’s primary key when the object is created. If the same row is retrieved again by this DataContext object, the o
阅读全文
摘要:Transactions have four essential attributes: atomicity, consistency, isolation, and durability (known as the ACID attributes). ■ Atomicity The work cannot be broken into smaller parts. Although...
阅读全文
摘要:When DbDataAdapter is used to retrieve or update data, it examines the status of the con- nection. If the connection is open, the DbDataAdapter uses the open connection and leaves the connection...
阅读全文
摘要:A DbDataReader object provides a high-performance method of retrieving data from the data store. It delivers a forward-only, read-only, server-side cursor. This makes the DbDataReader object a...
阅读全文
摘要:It’s common practice to store connection strings in the Web.config file. This makes it easy to change the connection string without requiring a recompile of the application. However, connec-tion strings can contain logon information such as user names and passwords. You certainly don’t want this inf
阅读全文
摘要:EXAM TIPRemember for the exam that setting the RemotingFormat property to SerializationFormat.Binary is required to obtain true binary serialization.
阅读全文
摘要://read xml file into datasetDataSet vendorData = new DataSet(); vendorData.ReadXmlSchema(desktopFileName("VendorSchema.xsd")); vendorData.ReadXml(desktopFileName("Vendors3.xml"), XmlReadMode.IgnoreSchema);
阅读全文
摘要:When theXmlWriteMode.WriteSchema is used as parameter, the resulting XML file is substantiallylarger. When few files are being generated for this data, this approach is acceptable,but if many files are being created, it would be better to create a separate XSD file that can beloaded before the data.
阅读全文
摘要:DataSet cars = new DataSet();cars.WriteXml(desktopFileName("CarWithSchema.xml"), XmlWriteMode.WriteSchema);
阅读全文
摘要:TheImportRow method is useful when theCurrentand Original data row version must be maintained. For example, after editing a datatable, you might want to copy the changedDataRow objects to a different data table butmaintain theOriginal and Current data row version. The ImportRow method on the DataTab
阅读全文
摘要:These methods can be executed only onDataRow objects whose row state is Unchanged.
阅读全文
摘要:Auto incrementing is found in many database products, but how can it possibly workproperly in your application? The connected classes haven’t been covered yet, but you canimagine that at some point you might want to send your new data to a back-end database. Ifyour application supplies the auto-incr
阅读全文
摘要:采用不离线的方式压缩access文件 调用: 出处:Compact a Microsoft Access database from .NET
阅读全文
摘要:将DataSet转换为xml时,若DataSet某一列全部为dbnull时,方法1不会丢失该列,方法2会丢失该列。方法1:using (StringWriter sw = new StringWriter()) { ds.WriteXml(sw, XmlWriteMode.WriteSchema); ReturnXml = sw.ToString(); return ReturnXml; }方法2...
阅读全文
摘要:首先,下载MySQL Connector/ODBC 3.51 Downloads 下载下来,安装完成后,到控制面板--〉管理工具--〉Data Source(ODBC), 双击,再点击Add按钮, 选择MySQL ODBC 3.51 Driver 之后,弹出连接mysql参数配置窗口,如下 把相应参数填写好之后,点Test,若连接成功,确定就配置好了。 下面是C#代码 Code Code...
阅读全文
摘要:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->// 一次执行多条sql语句 string strconn = @"Data Source=.\sqlexpress;Initial Catalog=info;Integr...
阅读全文
摘要:http://www.connectionstrings.com/
阅读全文
摘要:1,Download Connector/Net 5.2(odbc) and install 2, add reference "MySQL.Data.dll" 3, add connection in web.config file Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://ww...
阅读全文
摘要:数据库表通常都有一列或一组列,用于唯一地标识表中的每一行。这种具有标识作用的列或列组称为主键。
阅读全文
摘要:在 DataSet 中添加或刷新行以匹配使用 DataSet 名称的数据源中的行,并创建一个 DataTable。
阅读全文
1