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
807 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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now