[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

add data in marquee

Posted on 2004-05-03
9
Medium Priority
?
325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 

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 120 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

649 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