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 |
What is DLL hell?
What is econo-jit?
What are jagged arrarys ?
What is vb.net used for?
Name some of the features of C# which are not present in VB.NET?
What is strong name in .net assembly?
What would you do to remove microsoft visual basic name space?
Which control is an example of an object in vb net?
What is the difference between a "jagged array" and multidimensional array" ?can anyone show me it practically ?
i am attending to US consulate i kept my projects on vb.net ,please help me what questions will be ask on vb.net in us consulate
What is the difference between compiler and interpreter?
Explain strong name in .net assembly?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)