sql - Remove the only single column from datatable and insert it into a generic list of strings c# -
here method
public virtual list<string> getjobname(nullable<int> id, nullable<int> userid) { list<sqlparameter> parameters = new list<sqlparameter>(); var idparameter = id.hasvalue ? new sqlparameter("id", id) : new sqlparameter("id", typeof(int)); parameters.add(idparameter); var useridparameter = userid.hasvalue ? new sqlparameter("userid", userid) : new sqlparameter("userid", typeof(int)); parameters.add(useridparameter); table = executespdatatable("getjobname", parameters, out list); // datafiller<string> j = new datafiller<string>(); // list<string> rows = j.fromdatatabletolist(table); }
table holds 1 value, single job , want put single string list<string>
, return.
any help?
if variable table string, , want return string list of string, have this:
return new list<string>{ table };
Comments
Post a Comment