.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Articles >> ASP.NET >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Fetch data from the database and place it in a marquee

Posted By:Mahak Gupta       Posted Date: October 23, 2010    Points: 5    Category: ASP.NET    URL: http://www.dotnetspark.com  

Fetch data from the database and place it in a marquee

1. First we should take the marquee tag in the source  of our web form(Page.aspx) page like this:->

scrolldelay="300" style="height: 213px">

Note:-> literal to show the database values in the marquee

2.In Database:->

My Database Name:->db2

Create a table:->

create table news1


id int identity(1,1),

headings varchar(50)


3.Page.aspx coding:->

using System.Data.SqlClient;

SqlConnection conn1 = new SqlConnection("data source=AB\\SQLEXPRESS;initial catalog=db2;integrated security=true");

SqlDataAdapter da1 = new SqlDataAdapter("select * from news1?, conn1);
DataSet ds1 = new DataSet();
da1.Fill(ds1, "news1");
string s1;
s1 = "

s1 += "
s1 += "

s1 += ds1.Tables["news1"].Rows[0][1].ToString();
s1 += "

s1 += ds1.Tables["news1"].Rows[1][1].ToString();
s1 += "
lt1.Text = s1.ToString();

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend