We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to use carousel control for using database in vb.net (window form)

Thread ID:

Created:

Updated:

Platform:

Replies:

114538 Nov 23,2013 01:04 AM UTC Dec 5,2013 04:12 PM UTC WinForms 1
loading
Tags: Tools
amat
Asked On November 23, 2013 01:04 AM UTC

Hi!

    i want to create application pic view using database.i dont know to code for carousel..can you give simple application carousel using database.thank.

Kannan R [Syncfusion]
Replied On December 5, 2013 04:12 PM UTC

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;