2013年11月14日
摘要: form2.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace DataAdapter{ public partial class Form2 : Form { private DataSet ds = new DataSet(); p... 阅读全文
posted @ 2013-11-14 14:18 神秘藏宝室 阅读(2534) 评论(0) 推荐(0) 编辑
摘要: DataReader必须持续连接,所以在调用方法SqlDataReader作为返回类型时候,必须在方法外关闭流,很不方便。DataAdapter用于对数据源检索数据并填充到DataSet中的表。DataAdapter还可以将DataSet所做的更改进行解析回数据源。(通俗点,DataSet就是一个缓冲区,可以修改好数据,让DataAdapter返回回数据源)DataAdapter使用例程using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System. 阅读全文
posted @ 2013-11-14 12:06 神秘藏宝室 阅读(712) 评论(0) 推荐(0) 编辑
摘要: SQL代码:create database ThreeDbgoUSE ThreeDb;GOCREATE TABLE classify --分类表( id int primary key identity(1,1), name nvarchar(20) not null)GOCREATE TABLE product --产品表( id int primary key identity(1,1), name nvarchar(20) not null, price decimal, number int default 0, c_id int FOR... 阅读全文
posted @ 2013-11-14 11:04 神秘藏宝室 阅读(1192) 评论(0) 推荐(0) 编辑

 >>>转载请注明出处<<<