webservice代码
/// <summary>  
        /// 根据标题获取所有信息  
        /// </summary>  
        /// <returns>所有信息</returns>  
        public List<string> selectInfo(string title)
        {
            List<string> list = new List<string>();
            try
            {
                string sql = "select * from HInfo where Title=@title";
                SqlCommand cmd = new SqlCommand(sql, sqlCon);
                SqlParameter para = new SqlParameter("@title",title);
                cmd.Parameters.Add(para);
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    //将结果集信息添加到返回向量中  
                    list.Add(reader[0].ToString());
                    list.Add(reader[1].ToString());
                    list.Add(reader[2].ToString());
                    list.Add(reader[3].ToString());
                }
                reader.Close();
                cmd.Dispose();
            }
            catch (Exception)
            {            }
            return list;
        }
Android代码
其中Title可以接收到
/**
 * 获取所有货物的详细信息
 * 
 * @return
 */
public List<HashMap<String, String>> getInfo(String title) {
List<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
Log.v(title, "111111111111111111111");
arrayList.clear();
brrayList.clear();
crrayList.clear();
arrayList.add("Title");
brrayList.add(title);
crrayList = Soap.GetWebServre("selectInfo", arrayList, brrayList);
for (int j = 0; j < crrayList.size(); j += 3) {
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("Title", crrayList.get(j));
hashMap.put("Image", crrayList.get(j + 1));
hashMap.put("Info",crrayList.get(j + 2));
list.add(hashMap);
}
return list;
}
AndroidWeb服务

解决方案 »

  1.   

    string sql = "select * from HInfo where Title=@title";这个@是什么?
      

  2.   


     string sql = "select * from HInfo where Title="+title;
      

  3.   

    @是.net里的查询进行赋值的另一种方式 采用的是SqlParameter 进行查询条件的赋值
      

  4.   

    大神们我现在出现的问题不是sql语句的问题  问题是如何在exlipse进行那个title的赋值,  如我问题中android代码那块  我如何将那个title传到调用的webservice的方法中