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
Goran Bibic
480
2.9k
200.7k
Find max value in column and icrease for 1...
Mar 12 2018 7:19 AM
Why update complete column...not just active cell
SqlDataReader rdr;
SqlCommand cmd =
new
SqlCommand();
cmd.CommandText =
"select max(brojprijavnice2) from dbo.prijava_radnika WHERE radnik = '"
+ readerresultTextbox.Text +
"'"
;
cmd.Connection = con;
con.Open();
rdr = cmd.ExecuteReader();
int
max = 0;
while
(rdr.Read())
{
max = Convert.ToInt32(rdr[0].ToString());
Console.WriteLine(max);
}
con.Close();
String updateStaff =
"UPDATE [dbo].[prijava_radnika] SET [vrijemeodjave] = @vrijemeodjave, brojprijavnice2 = "
+ (max + 1) +
", [status] = 'odjavljen' WHERE radnik = '"
+ readerresultTextbox.Text +
"'"
;
Reply
Answers (
4
)
WebException: The remote name could not be resolved: 'https'
Designed data list box from database