我正在尝试使用SqlDataAdapter填充List,但我无法做到。除了数据适配器之外,还有其他方法可以填充字符串列表吗?请帮助我解决这个问题。谢谢。
下面是我的代码:
public List<String> JSONDataAll()
{
List<String> Users = new List<String>();
con.Open();
SqlCommand cmd = new SqlCommand("sp_sample_Proc", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(Users);
}
List<string>
。 - Ben Robinson