Solved

Error      1      Embedded statement cannot be a declaration or labeled statement      P:\PRD\Products\AHM\prod.CD\Code\ImportHtmlFilesInDB\ImportHtmlFilesInDB\main.cs      62      21      ImportHtmlFilesInDB

Posted on 2006-11-22
2
822 Views
Last Modified: 2008-01-16
if (openFileDialogDB.FileName == "")
                    return;
                else
                    CDataBaseTools DBConnection = new CDataBaseTools(openFileDialogDB.FileName);


Error      1      Embedded statement cannot be a declaration or labeled statement      P:\PRD\Products\AHM\prod.CD\Code\ImportHtmlFilesInDB\ImportHtmlFilesInDB\main.cs      62      21      ImportHtmlFilesInDB

           
0
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 9

Expert Comment

by:DrAske
ID: 17995373
have you tried this??
f (openFileDialogDB.FileName == "")
                    return;
CDataBaseTools DBConnection = new CDataBaseTools(openFileDialogDB.FileName);

just remove *else* keyword ..
0
 
LVL 9

Accepted Solution

by:
DrAske earned 250 total points
ID: 17995397
it doesn't make sense to add *else* in your case because if the first *if* statment evaluate to *true* then it will exit the block and the following statments (that comes after it) will not execute.

hope that helps,
regards,Ahmad;
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to copy file 14 92
Run tasks synchronously in background thread 19 82
Adjust the codes 3 65
Returning multiple values with a stored procedure 9 31
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question