专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Silverlight

小弟我用web服务返回数组,报错远程服务器返回了异常: NotFound

发布时间:2011-06-27 20:00:42 文章来源:www.iduyao.cn 采编人员:星星草
我用web服务返回数组,报错远程服务器返回了错误: NotFound,在线等
web服务方法代码
  public ArrayList GetSearchData(int userid,DateTime dt1,DateTime dt2)
  {
  string sql = string.Format("select questions.questionId,questions.customerId,questions.contactName,questions.Tel,questions.cEmail,questions.questionCon,questions.ctime,questions.questionState,questions.gjkstime,questions.quewctime,questions.gjdocid,questions.customerscore,questions.customerpj,quetype.quetype from questions left OUTER join quetype on quetype.typeId=questions.typeId where questions.customerId={0} and questions.ctime between '{1}' and '{2}'", userid, dt1, dt2);
  string connstr = ConfigurationManager.ConnectionStrings["ServeCustomers.Properties.Settings.ServeCustomerConnectionString"].ToString();
  SqlConnection conn = new SqlConnection(connstr);
  conn.Open();
  SqlDataAdapter sa = new SqlDataAdapter(sql, conn);
  conn.Close();
  conn.Dispose();
  DataSet ds = new DataSet();
  sa.Fill(ds, "SearchData");
  ArrayList al = new ArrayList();
  for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
  {
  GetQuestionsinfo gi = new GetQuestionsinfo();
  gi.usertel = ds.Tables[0].Rows[i]["Tel"].ToString();
  gi.contactname = ds.Tables[0].Rows[i]["contactName"].ToString();
  gi.quecontact = ds.Tables[0].Rows[i]["questionCon"].ToString();
  string questionid = ds.Tables[0].Rows[i]["questionId"].ToString();
  gi.serveid = Convert.ToInt64(questionid);
  string customerid = ds.Tables[0].Rows[i]["customerId"].ToString();
  gi.userid = Convert.ToInt32(customerid);
  gi.useremail=ds.Tables[0].Rows[i]["cEmail"].ToString();
  gi.quetype = ds.Tables[0].Rows[i]["quetype"].ToString();
  string dt = ds.Tables[0].Rows[i]["ctime"].ToString();
  gi.ctime = Convert.ToDateTime(dt);
  gi.gjtime = ds.Tables[0].Rows[i]["gjkstime"].ToString();
  gi.wctime = ds.Tables[0].Rows[i]["quewctime"].ToString();
  gi.customerscore = ds.Tables[0].Rows[i]["customerscore"].ToString();
  gi.customerthink = ds.Tables[0].Rows[i]["customerpj"].ToString();
  gi.gjdoc = ds.Tables[0].Rows[i]["gjdocid"].ToString();
  gi.questate = ds.Tables[0].Rows[i]["questionState"].ToString();
  al.Add(gi);
  }
   
  ds.Dispose();
  sa.Dispose();
   
  return al;
  }(单步调试,到这里就报错)

客户端调用方法代码如下:
 private void Search_Click(object sender, RoutedEventArgs e)
  {
  UserManageSoapClient ums = new UserManageSoapClient();
  ums.GetSearchDataCompleted += new EventHandler<GetSearchDataCompletedEventArgs>(ums_GetSearchDataCompleted);
  DateTime dt1=Convert.ToDateTime("2011/12/23 10:13:32");
  DateTime dt2 = Convert.ToDateTime("2011/12/23 10:15:39");
  ums.GetSearchDataAsync(1,dt1,dt2);
  }
  void ums_GetSearchDataCompleted(object sender,GetSearchDataCompletedEventArgs e)
  {
  if (e.Error != null)
  {
  MessageBox.Show(e.Error.ToString());
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: