How can I return multiple values from a class in C# I tried in the below way but it didn't work for me.
protected static string setvalues;
public static string myfunction()
{
cmd = new SqlCommand("SELECT * FROM category", con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
setvalues = dr[0].ToString();
}
con.Close();
return setvalues.ToString();
}
I have the following in Categories table
Mobiles
Laptops
Cloths
DVD players
Televisions
Cameras
Anybody please help me in building a code that can return thousands of values.
yeild return.