Question Locked
0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do i upload a photograph(passport)photo from a vb.net form to my database (sQL Server 2005)
2 replies
by sosabou Accepted solution
Clarifications
by tony hopkinson Accepted solution
is to get the Image, bitmap, png, into a stream.
Then you get that into an array of bytes
Then you create SQLCommand object and set query to something like
'Update MyPhotos Set Photo = @Photo Where PersonID = @Person'
That gives you a parameterised query
Then you create and add the parameters
SQLParameter param = new SqlParameter("@Photo", SqlDbType.Image);
command.Parameters.Add(param);
param.Value = ImageAsByteArray
Set up the where parameter
and execute the command.
Bit c# ish, because I don't use VB.net, but the .Net stuff is the same.
PIA isn't it.
This discussion is closed to new replies.
Trending Networks posts
Sort by Trending
Question Unanswered
How Can IT Teams Detect Hardware Bottlenecks in Business Networks?
0 helpful
0 replies
Question Locked
Using multi-NIC setup for NAS + router — better than VLAN?
0 helpful
4 replies
0 helpful
5 replies
Question Locked
Unknown device connected to my network
0 helpful
2 replies
Question Locked
How to change public IP without ISP?
0 helpful
2 replies