TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mohamed Somalia
NA
312
3.5k
VB.net Image Upaditng Problems
May 1 2018 9:10 AM
Hello I am using Vb.net i want to update Image in PicturePox1 already image save and then when i click Datagirdview want to update but there Error "Empty path name is not legal".
Sub
update()
If
con.State = ConnectionState.Open
Then
con.Close()
End
If
con.Open()
qry =
"Update Doc Set ID=@ID,IskaGade=@IskaGade,Aqoonsi=@Aqoonsi,Gate=@Gate,MarkhatiKowaaad=@MarkhatiKowaaad,MarkhatiLabaad=@MarkhatiLabaad,MarkhatiSadaxaad=@MarkhatiSadaxaad,Faahfaahin=@Faahfaahin,UserID=@UserID where RefNo=@RefNo"
cmd =
New
SqlCommand(qry, con)
Dim
i
As
Short
cmd.Parameters.AddWithValue(
"@ID"
, txtid.Text)
cmd.Parameters.Add(
New
SqlClient.SqlParameter(
"@IskaGade"
, SqlDbType.Image)).Value = IO.File.ReadAllBytes(a.FileName)
cmd.Parameters.Add(
New
SqlClient.SqlParameter(
"@Aqoonsi"
, SqlDbType.Image)).Value = IO.File.ReadAllBytes(b.FileName)
cmd.Parameters.Add(
New
SqlClient.SqlParameter(
"@Gate"
, SqlDbType.Image)).Value = IO.File.ReadAllBytes(c.FileName)
cmd.Parameters.Add(
New
SqlClient.SqlParameter(
"@MarkhatiKowaaad"
, SqlDbType.Image)).Value = IO.File.ReadAllBytes(d.FileName)
cmd.Parameters.Add(
New
SqlClient.SqlParameter(
"@MarkhatiLabaad"
, SqlDbType.Image)).Value = IO.File.ReadAllBytes(ex.FileName)
cmd.Parameters.Add(
New
SqlClient.SqlParameter(
"@MarkhatiSadaxaad"
, SqlDbType.Image)).Value = IO.File.ReadAllBytes(fr.FileName)
cmd.Parameters.AddWithValue(
"@Faahfaahin"
, txtremarks.Text)
cmd.Parameters.AddWithValue(
"@Date"
,
Date
.Today.ToShortDateString)
cmd.Parameters.AddWithValue(
"@UserID"
, txtUserID.Text)
cmd.Parameters.AddWithValue(
"@RefNo"
, txtref.Text)
cmd.ExecuteNonQuery()
MsgBox(
"Record Updated Successfully"
)
filldatagrid()
Image Reader in Gridview
Sub
readImageMarkhatithree(
ByVal
ID
As
String
)
Dim
dr
As
SqlDataReader, MyTest
As
Boolean
=
False
Dim
sql
As
String
If
con.State = ConnectionState.Open
Then
con.Close()
End
If
con.Open()
sql =
"Select MarkhatiSadaxaad from Doc where id ='"
& txtid.Text &
"'"
cmd =
New
SqlCommand(sql, con)
cmd.CommandType = CommandType.Text
dr = cmd.ExecuteReader
Do
While
(dr.Read =
True
)
Dim
bits
As
Byte
()
bits =
CType
(dr.Item(
"MarkhatiSadaxaad"
),
Byte
())
Dim
memorybits
As
New
MemoryStream(bits)
Dim
bitmap
As
New
Bitmap(memorybits)
Markhatisadaxaad.Image = bitmap
Markhatisadaxaad.SizeMode = PictureBoxSizeMode.StretchImage
Loop
dr.Close()
End
Sub
Reply
Answers (
2
)
how to use toggle button in Winform Application.
The Microsoft Jet database engine could not find the object