473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

picture saving in mysql using vb.net in window7

1
I want to save picture in mysql database using vb.net. it work in Window8 and xp but not working in window7. following is the code.
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand|Select|Wrap|Line Numbers
  1. Dim ms As MemoryStream = New MemoryStream
  2. PictureBox1.Image.Save(ms, Imaging.ImageFormat.Jpeg)
  3. Dim bytBLOBData(ms.Length - 1) As Byte
  4. ms.Position = 0
  5. ms.Read(bytBLOBData, 0, ms.Length)
  6. Dim prm As New MySql.Data.MySqlClient.MySqlParameter("@BLOBData", MySql.Data.MySqlClient.MySqlDbType.LongBlob, _
  7. bytBLOBData.Length, ParameterDirection.Input, False, _
  8. 0, 0, Nothing, DataRowVersion.Current, bytBLOBData)
  9. Dim ekle As New MySql.Data.MySqlClient.MySqlCommand("update ogrenci set resim=@BLOBData where id='" & ogrid & "'", cnn)
  10. ekle.CommandType = CommandType.Text
  11.  
  12. ekle.Parameters.Add(prm)
  13. Dim gln As Byte
  14. cnn.Open()
  15. gln = ekle.ExecuteNonQuery()
  16. MsgBox(gln.ToString)
  17. cnn.Close()
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What is the problem with it???????????
Sep 12 '13 #1
0 1303

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: linus | last post by:
Anyone try insert image or binary files to MySQL using ASP.NET? Thanks a lot
1
by: Devendra | last post by:
How could i insert a pdf file in mysql using PHP and when i access from database it must be open in .html format plz give me reply
0
by: Ginoboy | last post by:
Hello there I have a problem in executing mysql using java netbeans. all i want is to execute a batch file. this is my code: "try { ...
1
by: mohammedsk | last post by:
Hi, I am trying to save information into MySQL using PHP. The data I am saving is in Arabic language. The database table will show some "???" or other characters. If I insert the text directly...
1
by: ariel gons | last post by:
This is one of my project and also my thesis in school. How can I get data on database MYSQL using javascript function? Is there anybody here can help me with this problem.. Can anyone give...
1
by: chirag thakor | last post by:
how i can import data from Excel to MySql using php.
3
by: blackevanuz | last post by:
Hi I want to storage a txt file into mysql using a blob and after that extract it, the code i use to save it is: fs = new FileStream("C:\\Documents and Settings\\Pru.txt",...
9
paulrajj
by: paulrajj | last post by:
hi everybody, i am newbie to php and mysql. i have a little bit knowledge about php with xml. how to insert and select the records from xml to mysql using php?
3
by: emsik1001 | last post by:
Hi http://dev.mysql.com/doc/query-browser/en/mysql-query-browser-connection.html I'm trying to connect from my Windows based PC to a dedicated server which is running on Linux system. I...
4
by: apssiva | last post by:
Hi, i tiring to insert excel data into mysql using php. 1. i saved the Excel data as a CSV file. 2. i use below code to retrieve data. $fcontents = file('./ite_APS.csv');...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.