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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top