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
482
2.9k
198.1k
Counter count to 10, end then 10,10,10,10,...at 1 to 9 is ev
Mar 14 2018 9:34 AM
Counter count to 10, end then 10,10,10,10,...at 1 to 9 is everithing is ok...
What is wrong
SqlDataReader rdr;
SqlCommand cmd =
new
SqlCommand();
cmd.CommandText =
"select max(brojprijavnice2) from dbo.prijava_radnika "
;
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 +
"' and [status] = 'prijavljen'"
;
Reply
Answers (
7
)
Database Choice
System.dbnull.value null? APP not start if column null