XSDDataSet.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
- using System;
- using System.Data;
- using System.Data.SqlClient;
- public class XSD_DataSet
- {
- public static void Main ( )
- {
- string source = Login.Connection ;
- string select = "SELECT * FROM Products" ;
- using ( SqlConnection conn = new SqlConnection ( source ) )
- {
- SqlDataAdapter da = new SqlDataAdapter ( select , conn ) ;
- Products ds = new Products ( ) ;
- da.Fill ( ds , "Product" ) ;
- foreach ( Products.ProductRow row in ds.Product )
- Console.WriteLine ( "'{0}' from {1}" ,
- row.ProductID ,
- row.ProductName ) ;
- conn.Close ( ) ;
- }
- }
- }