先读成String ,在对这个String进行处理
或者是一行一行的读,在对每一行进行处理 存到DataRow中去,

解决方案 »

  1.   

    StreamReader的ReadLine方法读每一行。
    String的Split(',')方法按逗号分割,取得一个string[]数组。
      

  2.   

    e.g.StreamReader sr = new StreamReader(@"c:\date.txt");
    while( sr.Peek() >= 0 ){
        string[] src = sr.ReadLine();
        foreach( string str in src ){
            ...
        }
    }
      

  3.   

    char[] lines;
    try 
            {
                 using (StreamReader sr = new StreamReader("TestFile.txt")) 
                {
                    String line;
                    while ((line = sr.ReadLine()) != null) 
                    {
                        lines = line.Split(new char[]{','});
                        //给lines数组操作,添加到数据库中
                    }
                }
            }
            catch (Exception e) 
            {
                //异常处理
            }