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
818 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
  • 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

Independent Software Vendors: 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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

680 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