日期:2014-05-16  浏览次数:20401 次

求大神,在线等,asp 图片轮播调数据库问题
首页页面图片轮播调数据库地址。但要从两个不同的表调取id和address,id可能会重复。怎么调用啊????
  conn10.Open();
               SortedList<int,String> list10=new SortedList<int,string>();
               String sql10 = "select  id,address from dbo.image where weizhi='右边图片'";
                   System.Data.SqlClient.SqlCommand cmd10 = new System.Data.SqlClient.SqlCommand(sql10, conn10);
                   System.Data.SqlClient.SqlDataReader a10 = cmd10.ExecuteReader();
                   while (a10.Read())
                   {
                      
                       list10.Add((int)a10.GetSqlInt32(0), a10.GetSqlString(1).ToString());
                   }
                   a10.Close();
                       foreach (KeyValuePair<int, String> element in list10)
                       {
                           int id = element.Key;
                           string address = element.Value;
                           String sql11 = "select mkmc,biaoti from dbo.xwgg where  '是'=Display and id='" + id + "'";
                           System.Data.SqlClient.SqlCommand cmd11 = new System.Data.SqlClient.SqlCommand(sql11, conn10);
                           System.Data.SqlClient.SqlDataReader a11 = cmd11.ExecuteReader();
                           while (a11.Read())
                           {
                        &n