15,897,360 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by jdanastasi (Top 9 by date)
jdanastasi
27-Mar-13 15:13pm
View
y static increments the button works fine for the first 2 records but fails to output the third
jdanastasi
27-Mar-13 14:57pm
View
protected void Page_Load(object sender, EventArgs e)
{
con = new SqlConnection();
con.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True";
con.Open();
ds = new DataSet();
string sql = "SELECT * FROM Internet";
da = new SqlDataAdapter(sql, con);
da.Fill(ds, "Internet");
Maxrows = ds.Tables["Internet"].Rows.Count;
Records();
con.Close();
Label2.Text = inc.ToString();
Label3.Text = Maxrows.ToString();
}
private void Records()
{
drow = ds.Tables["Internet"].Rows[inc];
Label1.Text = drow.ItemArray.GetValue(1).ToString();
inc++;
}
protected void next1_Click(object sender, EventArgs e)
{
if (inc < Maxrows)
{
Records();
Label2.Text = inc.ToString();
}
}
}
jdanastasi
27-Mar-13 14:57pm
View
Deleted
protected void Page_Load(object sender, EventArgs e)
{
con = new SqlConnection();
con.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True";
con.Open();
ds = new DataSet();
string sql = "SELECT * FROM Internet";
da = new SqlDataAdapter(sql, con);
da.Fill(ds, "Internet");
Maxrows = ds.Tables["Internet"].Rows.Count;
Records();
con.Close();
Label2.Text = inc.ToString();
Label3.Text = Maxrows.ToString();
}
private void Records()
{
drow = ds.Tables["Internet"].Rows[inc];
Label1.Text = drow.ItemArray.GetValue(1).ToString();
inc++;
}
protected void next1_Click(object sender, EventArgs e)
{
if (inc < Maxrows)
{
Records();
Label2.Text = inc.ToString();
}
}
}
this is all the code I have
jdanastasi
27-Mar-13 14:30pm
View
inc is 0 and acts as a counter whilst max rows is the number of records I have in the database
jdanastasi
27-Mar-13 14:18pm
View
I am still having the same result and int inc = 0; is outside the function pageload
jdanastasi
27-Mar-13 14:06pm
View
private void Records()
{
DataRow drow = ds.Tables["Internet"].Rows[inc];
Label1.Text = drow.ItemArray.GetValue(1).ToString();
inc = inc +1;
}
jdanastasi
27-Mar-13 14:01pm
View
I have removed the inc as shown below and the Maxrows is 3 but its still the same
The record is a function that prints records to screen
protected void next1_Click(object sender, EventArgs e)
{
if (inc <= Maxrows)
{
Records();
Label2.Text = inc.ToString();
}
}
jdanastasi
27-Mar-13 13:50pm
View
once I click the next button it adds the second record and that's it
jdanastasi
27-Mar-13 13:21pm
View
I have a set of records to display using a next button. once the next button is clickeed it displays it in the same label. So far I am only displaying two the first on page load and the second on button clickl. though for test purposes I have 3 records
Show More