我现在的代码如下:好像只装了第一张图片进去。
 private void timer1_Tick(object sender, EventArgs e)
        {
            string sql_str = "select * from cj_main";
            SqlConnection conn = new SqlConnection(conn_str);
            SqlCommand command = new SqlCommand(sql_str, conn);
            conn.Open();
            SqlDataReader rs = command.ExecuteReader();
            if (rs.Read())
            {
                cj_names = rs[1].ToString();
                cj_pic_path = rs[3].ToString();
                List<Image> lst = new List<Image>();
                lst.Add(Image.FromFile(cj_pic_path));
                label1.Text = cj_names;
                if (i >= lst.Count)
                {
                    i = 0;
                }
                else
                {
                    this.pictureBox1.Image = lst[i];
                    this.pictureBox1.Image = lst[i]; 
                    pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
                    i = i + 1;
                }
            }
        }

解决方案 »

  1.   

    string sql_str = "select * from cj_main";
    SqlConnection conn = new SqlConnection(conn_str);
    SqlCommand command = new SqlCommand(sql_str, conn);
    conn.Open();
    SqlDataReader rs = command.ExecuteReader();你这代码放在tick事件中,那么,不是每次查询结果都一样么?
      

  2.   

    放在
    public Form1()
            {
                InitializeComponent();
                string sql_str = "select * from cj_main";
                SqlConnection conn = new SqlConnection(conn_str);
                SqlCommand command = new SqlCommand(sql_str, conn);
                conn.Open();
                SqlDataReader rs = command.ExecuteReader();
            }
      

  3.   

    imagelist保存数据后,没办法保存path
    使用List<T>等
    Load中获取数据到list<T>,在调用List<T>