谁有C#入门经典的源码,谢谢先

解决方案 »

  1.   

    遍历Customers表中所有的记录。
    DataSet dataSet11=new DataSet();
    SqlDataAdapter da=new SqlDataAdapter("SELECT CustomerID AS Expr1, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers",
    "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=ALAN;Connect Timeout=30");
    da.Fill(dataSet11,"Customers");
    DataTable table=dataSet11.Tables[0];
    DataRowCollection rows=table.Rows;
    foreach(DataRow row in rows) 
    {
    string Expr1=row[0].ToString(); //  row[0]是第1列中的记录。 Expr1是第1个字段的别名。
    string customerName=row[1].ToString();
    string contactName=row[2].ToString();
    string contactTitle=row[3].ToString();
    string Address=row[4].ToString();
    string City=row[5].ToString();
    string Region=row[6].ToString();
    string PostalCode=row[7].ToString();
    string Country=row[8].ToString();
    string Phone=row [9].ToString();
    string Fax=row[10].ToString();//因为类型不同 所以要进行ToString()进行转换。 }
      

  2.   

    http://www.vscodes.com/Sorting/Catalog3/Sorting_Indate_Desc_1.html
    http://www.host01.com/Get/Net/00020007/index_6.htm


    。。
    N 多 自己随便 摆渡一下  你看都看不来