Hi
Amat,
Thank
you for using Syncfusion products.
Query
|
Comments
|
i
want to create application pic view using database.
can
you give simple application carousel using database
|
Yes,
we have prepared sample that loads carousel child items background image from
Database.
Steps:
1)
New SQL database and table needs to be created.
2)
Need to save image in created database table as byte
array value.
Code Snippet:[VB]
Dim stream As New MemoryStream()
Me.panel1.BackgroundImage.Save(stream,System.Drawing.Imaging.ImageFormat.Jpeg)
Dim pic() As Byte=stream.ToArray()
com.Parameters.AddWithValue("@Pic", pic)
|
3)
And to load image in carousel, need to retrieve and
store saved image in DataTable.
4)
Carousel child panel image can be defined with this
retrieved image.
Code Snippet:[VB]
dp.Fill(ds, "MyImages")
Dim myRow As DataRow
myRow =
ds.Tables("MyImages").Rows(0)
MyData = CType(myRow("fldPic"),
Byte())
Dim stream As New MemoryStream(MyData)
'With
the code below, you are in fact converting the byte array of image
'to
the real image.
Me.panel2.BackgroundImage
= Image.FromStream(stream)
|
Please
find the sample in below location.
Sample
Location: Carosel
DB.zip
Note:
It
is needed to set SQL DB and its DataSource settings based on your machine.
|
Please
let us know if it helps,
Regards,
Kannan.R