解决方案 »
- 关于VS2008安装部署中合并其他安装包
- asp.net中 iframe 左边是树,右边是修改树的信息 如何在修改后 让左边树刷新并且保证右边页面停留在修改页面,我右边使用的是ajaxpro实现的无刷
- c#如何获取另外一个程序中的TDrawGrid表格中的数据?
- PrintDocument打印预览正常,打印时错位的问题
- [初学]帮我看看这段代码有什么问题
- windows服务读取配置文件的问题
- C++.NET如何调用C#写的类
- dataGrid里有没有办法全选数据?
- 使用npoi 操作excel 保存后没有写入
- 如何限制一个文本框只能输入数字?最好还能限制输入数字的大小。
- 关于sqlparamater有无指定Size的证明,但不是知道原因。
- ocx或dll怎么才能在chrome上使用?
CustomerDataSet customers = new CustomerDataSet();
SqlDataAdapter adapter = new SqlDataAdapter(
"SELECT * FROM dbo.Customers;",
"Data Source=(local);Integrated " +
"Security=SSPI;Initial Catalog=Northwind");adapter.Fill(customers, "Customers");foreach(CustomerDataSet.CustomersRow customerRow in customers.Customers)
Console.WriteLine(customerRow.CustomerID);
强类型还没有弱类型datatable好用?
你用linq或者迭代方式都可以替代循环的,不同的书写风格而已还有,弱类型强类型的说法是对面向对象设计的误读
数据就是数据,在通信中就应该是所谓“无类型的”,他们实现的是设计接口,
接口才是真正声明类型的,
一楼微软的例子中,微软的做法就是根据xml接口自动实现了CustomerId和对应字段的匹配,
只不过,这个过程是微软替我们实现的,
我们自己去实现更加容易和高效,因为这样就不用重复提供给ado.net一份接口的副本了
var _c = customers.Customers.First(p=>p.CustomerId=1);
Console.WriteLine( _c.Name);