Solved

add data in marquee

Posted on 2004-05-03
9
308 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
 

Author Comment

by:kenny4820
ID: 10987123
i cant quite understand it can u give better description ? really thx
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now