You cannot convert an object to int. Do some more research before asking for help
Nelson Costa Inacio
Posts
-
C# Specified cast is not valid -
Need help on how to if record exists update else insert c#Check this Microsoft SQL Server and Oracle Compared[^] Will help you to understand the differences between Oracle and SQL Server.
-
Specified cast is not valid. i can't understand errorThat error is telling you that he cannot convert DR object type to int. DR type is SQLDataReader, you cannot convert data reader to int. Why fill "vochcombox" twice? While loop should work, but foreach doesn't for sure.
-
Convert Char[ ] To Char ? [ ]No, Char is just a single letter or number. Char[] is a list of Chars. You can loop the list and concatenate a string or if the list have a fixed size declare a Char for each element and fill when you loop the list.
-
codingReuse code, if you repeating on 2 or more places consider put that inside a function and call it everywhere you need that code. Application resources consume. For example you have a variable that will have values between 0 and 20, declare it as byte instead of int. Byte support number until 256 and only consume 1 byte, int support a number until 2.147.483.647 but consumes 4 bytes. If you are loading a list of objects this can have a huge impact on performance. Comment code, give some hints of what you have done. When you have maintain code not developed by you, you will understand the importance of comment code.
-
C# Program Output??1. V = Extract dictionary.txt file content to a string V1 = Contains string[] 3rd element V2 = Contains string[] 4th element First = Extract from V the first string matching with V1 Last = Extract from V the first string matching with V2 l = Get from V the index of First l2 = Get from V the index of Last l3 = Length of Last - First Results = Skip first element and return next l3 elements Print Results The code is reading dictionary.txt and print all results between index of 3rd and 4th array element. 2. This code is hard to read. Variable names aren't intuitive. Doesn't seem to be necessary use var because some types aren't anonymous. ReadLines return a string[], V1 and V2 are strings, l, l2 and l3 are integer.
-
"Twitter is junk"If twitter is junk, why facebook isn't junk also?.
-
PostBack data lost ASP.NET 4.5Why not define a limit of rows to return?, for example 1000. If the user wants to find more specific information should use filters. That will avoid a large consume of memory due storing 25k rows on cache and the requests to database will take less time to process.
-
How to get today's dateAmazing bad code!!!!!!
-
How create an xls file with n sheetsWhy open excel without sheet????, makes no sense to me, even if i open excel directly he always shows a new sheet. That's not possible and have no sense.