Solved

add data in marquee

Posted on 2004-05-03
9
319 Views
Last Modified: 2008-03-10
i wanna add text in my database to a marquee ? how can i do it ? thx lots
0
Comment
Question by:kenny4820
  • 5
  • 4
9 Comments
 
LVL 1

Expert Comment

by:hengzhe
ID: 10984804
<%
dim rds,cnn
'create your connection object****
set rds=server.createobject("adodb.recordset")
sql="select * from smTable"
rds.open sql,cnn,1,3
%>
<marquee direction='left'><%= rds("COLUMNNAME") %></marquee>
0
 

Author Comment

by:kenny4820
ID: 10984880
this is in asp language? im using asp.net
0
 
LVL 1

Expert Comment

by:hengzhe
ID: 10985142
I am not familiar with asp.net,but I think the principle is the same.
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

Author Comment

by:kenny4820
ID: 10987123
i cant quite understand it can u give better description ? really thx
0
 
LVL 1

Expert Comment

by:hengzhe
ID: 10992638
Use ado(ado.net) to retrieve datium you need,then store it  in a variable which can be utilized to dynamically generate html code that represents a marquee tag,
such as '<marquee direction='left'>This text was generated dynamically according to corresponding datium in db.</marquee>'
0
 

Author Comment

by:kenny4820
ID: 10993482
sorry for asking again, ok i understand what are u saying , what i dun understand is how to retrieve data from database for only 1 ? if im not mistaken all the data are retrieve in table format right?

This is my connection , can u help me alter easier for me and u thx alot , really sorry for keep on asking ........

Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\Soccer\Socce"& _
".mdb"
        Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)

        Dim queryString As String = "SELECT [Web1].[header] FROM [Web1]"
        Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
        dbCommand.CommandText = queryString
        dbCommand.Connection = dbConnection

        Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
        dataAdapter.SelectCommand = dbCommand
        Dim dataSet As System.Data.DataSet = New System.Data.DataSet
        dataAdapter.Fill(dataSet)

0
 

Author Comment

by:kenny4820
ID: 11020554
anybody can help me?
0
 
LVL 1

Accepted Solution

by:
hengzhe earned 30 total points
ID: 11021488
Never mind.
But I am not familiar with asp.net,I had said that,I just assume that your code is
basically right.Below is my code (that's all I could do to help solve the problem,I think):

Dim strCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\Soccer\Socce.mdb"
        Dim dbCnn As System.Data.IdbCnn = New System.Data.OleDb.OledbCnn(strCnn)

        Dim strSql As String = "SELECT top 1 header FROM Web1"
'***I don't know whether you want to retrieve only 1 record each time, if that true,use the preceding sql statement.
        Dim dbCmd As System.Data.IdbCmd = New System.Data.OleDb.OledbCmd
        dbCmd.CommandText = strSql
        dbCmd.Connection = dbCnn

        Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
        dataAdapter.SelectCommand = dbCmd
        Dim dataSet As System.Data.DataSet = New System.Data.DataSet
        dataAdapter.Fill(dataSet)

      dim dataTable as DataTable=new DataTable
      dataTable = dataSet.Tables(0)
'***display datium in the marquee
      response.write("<marquee direction='lef'>")
      response.write(dataTable.rows(0).item(0))
      response.write("</marquee>")
0
 

Author Comment

by:kenny4820
ID: 11022632
need to alter a bit

dim dataTable as DataTable=new DataTable


should be

dim datatable as system.data.datatable = new system.data.datatable
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how can i make amazon approved mobile url 4 39
Dreamweaver code color same as CS6 or CS2015 2 35
Website Question - New Site 3 34
PHP Web Development 6 28
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question