Solved

add data in marquee

Posted on 2004-05-03
9
311 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
reposition hamburger icon to top of screen 5 60
Cordova Camera plugin fails 2 93
Advice on Xojo as a development tool over VB. 4 35
app server have enough resources... 2 23
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

911 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