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
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 |
Which is the tool which can convert visual basic old version to .net compatibility version?
What is late binding and early binding?
Is there any easy way to convert VB6 programs to VB.Net?
What is the feature anonymous type?
Write a program for calculator in VB.NET
6 Answers CMC, College School Exams Tests, IBM, NIIT, Practical Viva Questions, Subex,
What is a static class?
What is friend and protected-friend access specifier in vb.net?
Explain manifest?
What is the difference between manifest and metadata?
Write a program that would find the nth term of a geometric progression, given the value of first term and common ratio. Any inbuilt function that the language provides for calculating exponent should not be used.
sir i want to ask you that how can i fetch or get sql data into texboxes.where i want to show record in specific texboxes related to student information.when i click on button all data show on texboxes when i put id or name plz inform me on my id
What is VB.Net?