Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


hello
dear friends my problem is that i want to save images that
is pictures in SQL server using vb.net can any body help me
to do so please



hello dear friends my problem is that i want to save images that is pictures in SQL server using..

Answer / govind

step1) place one fileUpload control from tool box
step2) in it's Button click event
If FileUpload1.PostedFile Is Nothing Then
Response.Write("no file posted")

Else
Here Convert that image as byte and pass it
to function.
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim ds As New DataSet

con = New
SqlConnection(ConfigurationManager.AppSettings("connectionString"))
cmd = New SqlCommand("insert into tablename
values(@image_in), con)
Dim imageByte(FileUpload1.PostedFile.InputStream.Length) As
Byte

FileUpload1.PostedFile.InputStream.Read(imageByte, 0,
imageByte.Length)
cmd.Parameters.AddWithValue("@image_in",
imageByte)
con.Open()
cmd.ExecuteNonQuery()
con.Close()

Response.Write("file is inserted")
End If

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More VB.NET Interview Questions

Write a program for calculator in VB.NET

6 Answers   CMC, College School Exams Tests, IBM, NIIT, Practical Viva Questions, Subex,


What is difference between metadata and manifest?

0 Answers  


How do you rate yourself in .NET ?

3 Answers   Infosys, Seneca Global,


What are the advantages of an assembly?

0 Answers  


What is pre-jit?

0 Answers  


List the types of generations in garbage collector?

0 Answers  


What is intermediate language in .NET ?

20 Answers   Digital GlobalSoft,


What are the advantages of vb.net and c#?

0 Answers  


What are the parts of the visual basic control?

0 Answers  


What is the difference between compiler and interpreter?

0 Answers  


What is break mode? What are the options to step through code?

0 Answers  


What is JIT(Just In Time) and How it works?

5 Answers   Data Entry Operator, Infocons, Siemens,


Categories