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
814 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

770 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