toopak
یک شنبه 10 شهریور 1387, 01:42 صبح
سلام دوستای گل
من میخوام از توی بانک یه سری اطلاعات رو توی فرم نمایش بدم
کدم اینه:
Dim cmdsql As New OleDbCommand
Dim inssql As String
cmdsql.Connection = con
inssql = "SELECT * FROM tbdrivers where tbdrivers.drid= " & Label1.Text
cmdsql.Connection = con
cmdsql.CommandText = inssql
Dim DR As OleDbDataReader
DR = cmdsql.ExecuteReader
If DR.HasRows = True Then
DR.Read()
TextBox4.Text = DR("drname")
TextBox1.Text = DR("drcartype")
TextBox3.Text = DR("dradd")
SlrTextbox2.Text = DR("drcarno")
SlrTextbox1.Text = DR("drtell")
SlrTextbox4.Text = DR("drmob")
Label9.Text = DR("drdevelop")
PictureBox1.Image = DR("drimg")
اما موقع اجرا ارور زیر رو میده
Unable to cast object of type 'System.Byte[]' to type 'System.Drawing.Image'
مشکل از کجاشه؟
چه کدی رو باید استفاده کنم؟
بانکم هم اکسس
ممنون میشم ازتون:خجالت:
من میخوام از توی بانک یه سری اطلاعات رو توی فرم نمایش بدم
کدم اینه:
Dim cmdsql As New OleDbCommand
Dim inssql As String
cmdsql.Connection = con
inssql = "SELECT * FROM tbdrivers where tbdrivers.drid= " & Label1.Text
cmdsql.Connection = con
cmdsql.CommandText = inssql
Dim DR As OleDbDataReader
DR = cmdsql.ExecuteReader
If DR.HasRows = True Then
DR.Read()
TextBox4.Text = DR("drname")
TextBox1.Text = DR("drcartype")
TextBox3.Text = DR("dradd")
SlrTextbox2.Text = DR("drcarno")
SlrTextbox1.Text = DR("drtell")
SlrTextbox4.Text = DR("drmob")
Label9.Text = DR("drdevelop")
PictureBox1.Image = DR("drimg")
اما موقع اجرا ارور زیر رو میده
Unable to cast object of type 'System.Byte[]' to type 'System.Drawing.Image'
مشکل از کجاشه؟
چه کدی رو باید استفاده کنم؟
بانکم هم اکسس
ممنون میشم ازتون:خجالت: