Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
837 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 1000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

886 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