我想问一下,我要查找一个product所有的内容,如果sql语句 里面select 不写成查找具体列,而是直接换成*,那datarow会识别出这个表里面的所有列吗?
因为我这样输出的。直接把所有列通过列名写出来的。
console.writeline{"{0}--{1}",row["CustomerID"], row["CompanyName"]}; 
这样写感觉很麻烦呦,DataRow有没有不用把所有列名都写出来的方法。
strSQL = "select * form Products"; 
strSQL = "select  CostumerID, CompanyName form Products";
sda.Fill(ds,"product"); foreach (DataRow row in ds.Tables[product].Rows)
   Console.WriteLine{"{0}--{1}",row["CustomerID"], row["CompanyName"]};