Solved

add data in marquee

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

856 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