TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ajay raju
NA
398
0
Display Next Records in Textboxes in Web Application
Apr 16 2010 1:57 AM
hi!
i am taking emp table in sqlserver. that table contains Eno,Ename,Sal columns and insert some values into the Table.
And in my Web form i take 3 labes for column names and 3 textboxes for showing Employee Details. and Take Next Button.
i write code like
int Rowno = 0 (declared in class)
in form load i create objects to sqlconnection,sqldataadapter,dataset
code under Next button click
If
(Rowno < ds.Tables(0).Rows.Count - 1)
Then
rno += 1
TextBox1.Text = ds.Tables(0).Rows(Rowno)(0).ToString()
TextBox2.Text = ds.Tables(0).Rows(Rowno)(1).ToString()
TextBox3.Text = ds.Tables(0).Rows(Rowno)(2).ToString()
Else
MessageBox.Show(
"Last Record"
) // messagebox write only in vb.net and in asp.net i write Response.write("Last Record")
End
If
This code
write in Windows forms its working. and i create same design in ASP.net webpage and write above code under next button, it increment only one time. because when i click button it take Rowno is 0. i click button number of times it take Rno is 0. so bydefault it increment one tme.
my doubt is this type of program is doing in web applications? if do please tell a process.
Thanks.
Reply
Answers (
1
)
hiding a menu items in masterpage
Photogallery in asp.net and c#