Adrotator control.. programming

A

Aussie Rules

Hi,
I have a adrotator control on a page, and want to program the connection of
the control via SQL.

I have the following code, but not sure what else to do?


Dim SQLServerConnection As SqlConnection
Dim SqlConnectionCls As New clsSQL
SQLServerConnection = SqlConnectionCls.Connect

Dim SqlCommand As New SqlCommand

With SqlCommand
.CommandType = Data.CommandType.StoredProcedure
.Connection = SQLServerConnection
.CommandTimeout = 15
.CommandText = "sproc_GetAddDetails"
End With

Me.AdRotator1.DataSource = SqlCommand

AdRotator1.ImageUrlField = "advert_image"
AdRotator1.NavigateUrlField = "advert_URLlink"
 
S

Steven Cheng[MSFT]

Hi Aussie,

Regarding on this issue, I have also seen your another one in the following
newsgroup:

Subject: Adrotator
Newsgroups: microsoft.public.dotnet.framework.aspnet

Community member Alexey and I have posted some suggestion there. Please
have a look and feel free to followup in that thread if you have any
further questions.

Thanks for your posting!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Aussie Rules

Hi Steven,

Thanks for your reply.

I am still not able to get this to work. My code is as follows. When I view
source of the HTML page, there are no values for the adrotator at all.
The Stored Proc works fine.


Try

Dim SQLServerConnection As SqlConnection
Dim SqlConnectionCls As New clsSQL
SQLServerConnection = SqlConnectionCls.Connect
Dim SqlCommand As New SqlCommand

With SqlCommand

.CommandType = Data.CommandType.StoredProcedure
.Connection = SQLServerConnection
.CommandTimeout = 15
.CommandText = "sproc_GetBannerAdvertDetails"

End With

' I have swapped these arround and tried, but not working. I have put the
image/navurl after the databind.

AdRotator1.ImageUrlField = "advert_image"
AdRotator1.NavigateUrlField = "advert_URLlink"
AdRotator1.DataSource = SqlCommand.ExecuteReader
AdRotator1.DataBind()

Catch ex As Exception


End Try
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top