小弟我用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());
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
新手求助LineSeries折线的圆点怎么去掉
由于数据比较密集,LineSeries的圆点很大程度上影响了折线图的展示,请问可不可以设置式样把...
-
求教大家:如何继承SL5中的DrawingSurface?
自己写了一个MyDrawingSurface类,继承自DrawingSurface,只在原有基础上新增了几个属性而已...
-
[讨论]Silverlight5 RTM 只能在OOB模式下使用3D硬件加速?
来自:http://silverlight.bayprince.com/tutorials.php?tutorial=8
Silv...
-
LineSeries横轴名称重叠问题
LineSeries横轴名称多的时候,就会重叠,看不清楚,有设置让不重叠,省略一些名称
------解决方案---------...
-
Silverlight DataGrid依某列值決定字体顏色
比如:表里有三列:id,namd,age
我希望当age<18时,age数字的颜色为红色.
本人在网上查过...
-
新手问题,关于WPF的DataGrid控件列标题居中问题!
内容居中已经解决但是标题居中查过一些资料无果!网上有silverlight 4的DataGrid居...
-
serverlight 地图路径查询
就是在serverlight地图上创建两个点,实现最短路径的查询功能,不知道有发实现吗?
------解决方案--------...
-
Microsoft Expression Blend 4 的密钥谁有?
下载了一个Microsoft Expression Blend 4 可是要密钥 怎么办
------解决方案--------...
-
silverlight的输入框在win7平板电脑上不能被感知
最近用了个win7的平板电脑,普通页面如果有输入框,光标点击在上面,光标附件会出现一...
-
Win 8将Silverlight和.Net打入冷宫?
在D9大会上,微软演示了Windows 8如何为应用程序整合了一个以触摸操作为主的用户界面,这些应用...