Web Service Array method

C

cwbp17

How do I use the Web Service array method below and display the results to a
gridview on the client?

using C#:

My Web Service method:

[WebMethod]
//[XmlInclude(typeof(empname))]

public ArrayList GetData(ArrayList data)
{
ArrayList newList = new ArrayList();

OracleConnection oraConn = new OracleConnection();

oraConn.ConnectionString = "Data Source=localhost;User
ID=scott;Password=tiger";

string select = "select ename from emp where JOB='MANAGER'";

OracleCommand cmd = new OracleCommand(select, oraConn);
OracleDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
object[] values = new object[reader.FieldCount];
reader.GetValues(values);
newList.Add(values);
}

return newList;
}

Any suggestions would be appreciated.

Also, if there are simple examples using arrays in a web service method that
would be appreciated.

Thanks.
bebop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top