iT邦幫忙

0

ADO.NET讀不出圖片

#如題我用資料聯繫,因為要做上下頁關係,所以程式碼都用手輸入的,但是讀出圖片時錯誤,麻煩請看一下原因是?

BindingManagerBase bm;
this.categoriesTableAdapter.Fill(this.northwindDataSet.Categories);
            SqlConnection conn = new System.Data.SqlClient.SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True");
            string strSql = "select* from Categories";
            DataSet ds = new DataSet();
            SqlDataAdapter daproduct = new SqlDataAdapter(strSql, conn);
            daproduct.Fill(ds, "Categories");

            textBox1.DataBindings.Add("Text",ds, "Categories.CategoryName");
            textBox2.DataBindings.Add("Text", ds, "Categories.Description");
            *pictureBox1.DataBindings.Add("Image",ds,"Categories.Picture"); *
            //這行錯誤,錯誤提示是無法將值格式化所需的類型
            bm = this.BindingContext[ds, "Categories"];

超超 iT邦新手 5 級 ‧ 2016-12-20 00:38:59 檢舉
ImageUrl

尚未有邦友回答

立即登入回答