Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to scroll data from database like fields are(id,url, description,location)

When I change location marquee will change, when page is load first time it works, but when I change location by drop down list its not working.

I used using asp:Literal + HTML but it is not scrolling.

VB
Protected Sub CityList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CityList.SelectedIndexChanged
        Call gmrq1(CityList.SelectedValue)
        Literal_Mrq.Text = "<MARQUEE bgcolor='Yellow' height='28' onmouseout='this.start();'  önmouseover='this.stop();' >'" & Session("MRQLOCA") & "'</MARQUEE>"
        RaddR1.AdvertisementFile = "~\app_data\" & LCase(CityList.SelectedItem.ToString) & ".xml"
        RaddR2.AdvertisementFile = "~\app_data\" & LCase(CityList.SelectedItem.ToString) & ".xml"
        'CityList.SelectedItem.ToString()
    End Sub

Private Function gmrq1(ByVal vlocation As String) As Boolean
        Dim sqlstr As String
        Dim CON As New MySqlConnection
        Dim MYDA As New MySqlDataAdapter
        Dim MYDS As New DataSet()
        Dim i As Integer
        Dim mrq As String
        Dim spc As String
        Dim xalink As String
        Dim calink As String
        Session("MRQLOCA") = Nothing
        mrq = " "
        spc = "                                   "
        Try
            vuser = Session("The_user")
            CON = New MySqlConnection("server=localhost; user id=" & vuser & "; password=alok; database=renton; pooling=false;")
            sqlstr = "select * from msgmrq where location='" & vlocation & "'"
            MYDA = New MySqlDataAdapter(sqlstr, CON)
            MYDS = New DataSet()
            MYDA.Fill(MYDS)
            If MYDS.Tables(0).Rows.Count > 0 Then
                calink = ""
                For i = 0 To 6
                    xalink = ""
                    mrq = mrq + xalink + MYDS.Tables(0).Rows(i)("ctext") + calink + spc
                Next
                Session("MRQLOCA") = mrq
            Else
                Session("MRQLOCA") = "Savvy Solution Private Limited"
            End If
        Catch myerr As MySqlException
            MsgBox("Renton Error #157 with message -" & myerr.Message, , "Renton Error")
        Catch e As Exception
            MsgBox("Renton Error #158 with message -" & e.Message, , "Renton Error")
            Throw
        Finally
            CON.Close()
        End Try
    End Function
Posted
Updated 3-May-11 20:55pm
v4
Comments
Hemant__Sharma 3-May-11 9:35am    
Can you provide some code with which you are trying this?
Keith Barrow 4-May-11 2:56am    
You Should Update the question rather than replying, I know this is confusing but there it is. I will delete your comments containing code.
Manfred Rudolf Bihy 3-May-11 9:51am    
What do you mean by "not clearly scrolling"?
Sandeep Mewara 3-May-11 10:32am    
What help?
Keith Barrow 3-May-11 10:51am    
Could be anything, can you provide code. Is the Dropdown list posting back even?

1 solution

hello,

View source of your web page in web browser then locate your literal control's markup after postback. you should see something like
"<MARQUEE bgcolor='Yellow' height='28' onmouseout='this.start();' önmouseover='this.stop();' >'" & data value & "'</MARQUEE>"

if it is not generated something is wrong with your logic. you can always compare page source of things working and not working scenarios.

the selected index event of combo box should contain exact replica of first time markup initialization.

Thanks,
Hemant
 
Share this answer
 
Comments
Member 7892050 4-May-11 4:31am    
on load its generate but after clicking datacombo box its not showing but immediate window its showing Session("MRQHOME")="aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbb "

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Call gmrq("Home")
Literal_Mrq.Text = "<MARQUEE bgcolor='Yellow' height='28' onmouseout='this.start();' önmouseover='this.stop();' >'" & Session("MRQHOME") & "'</MARQUEE>"
End If
Private Function gmrq(ByVal vlocation As String) As Boolean
Dim sqlstr As String
Dim CON As New MySqlConnection
Dim MYDA As New MySqlDataAdapter
Dim MYDS As New DataSet()
Dim i As Integer
Dim mrq As String
Dim spc As String
Dim xalink As String
Dim calink As String
Session("MRQHOME") = Nothing
mrq = " "
spc = "                                   "
Try
vuser = Session("The_user")
CON = New MySqlConnection("server=localhost; user id=" & vuser & "; password=alok; database=renton; pooling=false;")
sqlstr = "select * from msgmrq where location='" & vlocation & "'"
MYDA = New MySqlDataAdapter(sqlstr, CON)
MYDS = New DataSet()
MYDA.Fill(MYDS)
If MYDS.Tables(0).Rows.Count > 0 Then
calink = ""
For i = 0 To 6
xalink = ""
mrq = mrq + xalink + MYDS.Tables(0).Rows(i)("ctext") + calink + spc
Next
Session("MRQHOME") = mrq

End If
Catch myerr As MySqlException
MsgBox("Renton Error #157 with message -" & myerr.Message, , "Renton Error")
Catch e As Exception
MsgBox("Renton Error #158 with message -" & e.Message, , "Renton Error")
Throw
Finally
CON.Close()
End Try
End Function

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900