returning arrays from function
C#
2
Posts
2
Posters
0
Views
1
Watching
-
i have to return a string array from a function. I hv to retrieve the name to employees from emp table having certain code and return it to the calling function to be used for other purpose. thanx in advance
public string[] getname() { DataSet ds = yourquery string[] abc = new string[ds.Tables[0].Rows.Count]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { abc[i] = ds.Tables[0].Rows[i]["name"].ToString(); } return abc; }