OLEDBDATAREADER GETSTRING SPECIFIED CAST IS NOT VALID

What am I doing wrong? Thanks for the help! You need to work out what that means, and handle it appropriately. It’s like it’s not pulling anything from the database for bas. Do you need your password? Member 5-Nov 2: Glad your own solution worked out for you. This email is in use.

Treat my content as plain text, not as HTML. Thanks for the help! This email is in use. Add your solution here. Jim Fell Jim Fell 5, 27 I looked in the database and you were right; there is no data in that row for that field.

Might that value be null? Something is wrong with my query, or the way I am processing the results. Understand that English isn’t everyone’s first language so be lenient of bad spelling and grammar. Member 5-Nov 2: Post Your Answer Discard By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued use of the website is subject to these policies. Insults are not welcome. Jim Fell Jim Fell oedbdatareader, 27 Now that I know what’s happening I can handle it.

If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem.

  DAS TRAUMHOTEL SEYCHELLEN GANZER FILM

IsDBNull 1 is returning true GetString 0 does it work? GetString 1 I get the same error. Thanks for the help! You may want to modify the query to not include such rows, or use reader. Stack Overflow works best with JavaScript enabled. Provide an answer or move on to the next question. GetString method is throwing an exception:. If you call reader. You need to work out what that means, and handle it appropriately. Member 5-Nov 3: If your Cell format is set to General you should change apecified to Text.

Forums – C# Corner

Both columns are of type Text. Add your solution here. The error happens when the value you are getting is DBNull. Existing Members Sign in to your account. Sign up using Facebook. Mohan Gopi 5-Nov 2: Do you need your password?

When answering a question please: Sometimes it happens because of Cell format. When I step through it does evaluate to 1 as expected.

Glad your own solution worked out for you. I know that the Open and Close methods work. Don’t tell someone to read the manual. Articles Oledbdatareaedr Answers Messages Use my saved content filters. Chances are they have and don’t get it.

specified cast is not valid

Close ; I know that the Open and Close methods work. I looked in the database and you were right; there is no data in that row for that field. And what does reader.

  DE KROKODILLENBENDE FILM

GetString i ; so how i can there two columns fill completely by this but for third column it shows that error. Read the question carefully. Check your columns Datatype in DB based on that u should convert when your adding rows specfied gridview. What’s the type of that column? Member Mar 9: Specified cast is not valid. Sign up using Email and Password.

c# – ing Exception – Specified cast is not valid – Stack Overflow

What am I doing wrong? Let’s work to help developers, not make them feel stupid. After that, make the necessary conversion to string. Add ” 4″” Enroll Date” ; and my complete code here public partial class frmenrolldetails: Post as a guest Name.

Treat my content as plain text, not as HTML.