It's SQL complaining that some table or column name does not exist.
Do two things:
1) Use the debugger to find out which SQL statement is giving the error.
2) Look closely at the error message, which normally tells you the name of the item it can't locate:
The multi-part identifier "blah.blah" could not be bound.
Then look closely at the SQL you located - chances are you misspelled a name.
Quote:
Debug no errors. When start app and test error is: ,,The multi-part identifier "System.Data.SqlClient.SqlCommand" could not be bound.,,
Now look at your code:
SqlCommand osobaId = new SqlCommand(selektujradnika);
...
string provjeraprijavestring = "SELECT COUNT (*) FROM dbo.prijava_radnika WHERE radnik= " + osobaId + " and vrijemeodjave is null and status='prijavljen'";
SqlCommand komandaprijave = new SqlCommand(provjeraprijavestring, con);
...
int userCount = (int)komandaprijave.ExecuteScalar();
So you are concatenating a string to form an SQL command - which is ALWAYS a bad idea - and trying to use an SqlCommand object as a value to look for?
The default ToString implementation for an object is the full name of the object, so in this case your command as passed to SQL becomes:
SELECT COUNT (*) FROM dbo.prijava_radnika WHERE radnik= System.Data.SqlClient.SqlCommand and vrijemeodjave is null and status='prijavljen'
And SQL Server assumes that you are trying to specify a unique object within the SQL engine.
See how much it helps when you give the whole error message?
And by the way: "Debug no errors" is wrong: Compiling is not debugging. Debugging is the process of looking at an application while it is running, and gathering information about what it is doing. If you have run this code in the debugger, it would have told you treh problem was on the line
int userCount = (int)komandaprijave.ExecuteScalar();
and you could have looked at the command string directly and seen the problem - even fixed it and tried again!