Click here to Skip to main content
15,884,857 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to store the values of the query in a array so that i want to get them 1 by i on another page as request.querystring

C#
query = "select xgename,eaname from dieselback where sde_in_charge=" & quer
Posted
Updated 22-Aug-11 22:51pm
v2
Comments
Herman<T>.Instance 23-Aug-11 4:52am    
your question is not clear te me. Use Improve Question button to explain your exact problem.

1 solution

example:
C#
public static ArrayList FillArrayList(String StoredProcedure, List<sqlparameter> sqlParameters, String ConnectionName)
        {
            ArrayList list = new ArrayList();
            try
            {
                using (SqlDataReader reader = FillDataReader(StoredProcedure, sqlParameters, ConnectionName))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            Object[] listValues = new Object[reader.FieldCount];
                            reader.GetValues(listValues);
                            list.Add(listValues);
                        }
                    }
                    reader.Close();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }

            return list;
        }</sqlparameter>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900