【发布时间】:2009-09-23 08:04:45
【问题描述】:
如何将数据库值分配给数组。我试过这样...
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();
}
}
但它给出了无法将字符串转换为字符串[]的错误 请帮帮我
【问题讨论】:
标签: asp.net