|
-
November 20th, 2009, 09:44 AM
#1
Web Service function not returning arraylist
Hi,
I have a web service that returns an ArrayList that is working fine when tested when invoking the service. However, when I call the function from aremote app I get NULL objects.
Wb Service function.
Code:
public ArrayList GetTicketsForOffline()
{
// Connect to DB
SqlConnection connStr = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["idaura"]);
// Call sproc
string procString = "pr_ticket_all_get";
SqlCommand cmd = connStr.CreateCommand();
cmd.CommandText = procString;
cmd.CommandType = CommandType.StoredProcedure;
connStr.Open();
// run sproc
cmd.ExecuteNonQuery();
SqlDataAdapter dataAdapter = new SqlDataAdapter();
dataAdapter.SelectCommand = cmd;
// Setup Dataset
DataSet dsTickets = new DataSet();
// Loop thru and store data into Dataset
dataAdapter.Fill(dsTickets, "Tickets");
// display the rows in the Tickets DataTable
ArrayList arrTickets = new ArrayList();
DataTable tickets = dsTickets.Tables["Tickets"];
foreach (DataRow ticket in tickets.Rows)
{
TicketVO ticketsObj = new TicketVO();
ticketsObj.TicketID = (int)ticket["ticket_id"];
ticketsObj.EventID = (int)ticket["event_id"];
ticketsObj.OrderID = (int)ticket["order_id"];
ticketsObj.StatusID = (int)ticket["ticket_status_id"];
ticketsObj.TypeID = (int)ticket["ticket_type_id"];
ticketsObj.IPAddress = (string)ticket["ip_address"];
ticketsObj.SaleDate = (DateTime)ticket["issue_date"];
ticketsObj.ScanDate = DateTime.Now;
arrTickets.Add(ticketsObj);
}
// Close Connection
connStr.Close();
return arrTickets;
}
Call to function which return NULL objects
Code:
ArrayList arrTickets = new ArrayList(service.GetTicketsForOffline());
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|