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
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