如何爲數組指定數據庫值。我想是這樣的...如何爲陣列指定值
da = new SqlDataAdapter("select emname from emp", con);
ds = new DataSet();
da.Fill(ds, "emp");
if(ds.Tables [0].Rows.Count >0)
{
for(int i=0;i<ds.Tables [0].Rows .Count ;i++)
{
string[] myArray = ds.Tables[0].Rows[i]["emname"].ToString();
}
}
,但它給能串不能轉換爲字符串錯誤[] 請幫我
@ surya-如果你決定來看看LINQ,你會想看看LINQ to DataSet - http://msdn.microsoft.com/en-us/library/bb386977.aspx – RichardOD 2009-09-23 08:11:22
謝謝你能告訴我哪本書可以參考 – 2009-09-23 08:11:57
LINQ in Action(Fabrice Marguerie,Steve Eichert,和Jim Wooley)和Pro LINQ(Joe Rattz)都很好。我也聽說過關於Essential LINQ(Charlie Calvert和Dinesh Kulkarni)的好消息,但我還沒有讀過它。 – 2009-09-23 08:13:44