Compiler Error Message: CS1002: ; expected

Hello,

I keep getting the following error :

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS1002: ; expected

Source Error:


Line 220:	    cmd.ExecuteNonQuery();
Line 221:            SqlCommand cmd = new SqlCommand("SELECT LASTUSED FROM MRISEQ WHERE UPPER(SEQID)='CASEID'", conn);
Line 222:            Dim lastused As OleDbDataReader = cmd.ExecuteReader(); 
Line 223:            lastused.Read();                   
Line 224:	   //Create command

Source File: c:\WEBS\Development1\ClientSite\CaseEntry\CST_CreateCaseNew1.aspx.cs    Line: 222 

The code look like the following :

SqlConnection conn;
            SqlCommand comm;
            //Read the connection string from Web.config 
            string connectionString = ConfigurationManager.ConnectionStrings["TEST_CRM"].ConnectionString;
            //Initialize connection
            conn = new SqlConnection(connectionString);
            //LOCK MRISEQ TABLE - GET NEXT CASE ID AND UPDATE LAST USED 
	    SqlCommand cmd = new SqlCommand("UPDATE MRISEQ SET LASTUSED=LASTUSED+1 WHERE UPPER(SEQID)='CASEID'", conn);
	    cmd.ExecuteNonQuery();
            SqlCommand cmd = new SqlCommand("SELECT LASTUSED FROM MRISEQ WHERE UPPER(SEQID)='CASEID'", conn);
            Dim lastused As OleDbDataReader = cmd.ExecuteReader(); 
            lastused.Read();      

From the message it saying that I am missing a semicolon. I looked to see where I am missing it and I can't determine where I need to blug it in. any help would be really appreciated.
0
rzaboura
11/4/2008 8:17:00 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

2 Replies
1368 Views

Similar Articles

[PageSpeed] 56

Hi,rzaboura

As far as i understood  although it is not readable as u have post .

U r using both C#.net and Vb.net code in the same page I have made them in Bold.

rzaboura:
Hello, I keep getting the following error : Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1002: ; expected Source Error: Line 220: cmd.ExecuteNonQuery(); Line 221: SqlCommand cmd = new SqlCommand("SELECT LASTUSED FROM MRISEQ WHERE UPPER(SEQID)='CASEID'", conn); Line 222: Dim lastused As OleDbDataReader = cmd.ExecuteReader(); Line 223: lastused.Read(); Line 224: //Create command Source File: c:\WEBS\Development1\ClientSite\CaseEntry\CST_CreateCaseNew1.aspx.cs Line: 222 The code look like the following : SqlConnection conn; SqlCommand comm; //Read the connection string from Web.config string connectionString = ConfigurationManager.ConnectionStrings["TEST_CRM"].ConnectionString; //Initialize connection conn = new SqlConnection(connectionString); //LOCK MRISEQ TABLE - GET NEXT CASE ID AND UPDATE LAST USED SqlCommand cmd = new SqlCommand("UPDATE MRISEQ SET LASTUSED=LASTUSED+1 WHERE UPPER(SEQID)='CASEID'", conn); cmd.ExecuteNonQuery(); SqlCommand cmd = new SqlCommand("SELECT LASTUSED FROM MRISEQ WHERE UPPER(SEQID)='CASEID'", conn); Dim lastused As OleDbDataReader = cmd.ExecuteReader(); lastused.Read(); From the message it saying that I am missing a semicolon. I looked to see where I am missing it and I can't determine where I need to blug it in. any help would be really appreciated.

 


RAGHAV

MVP ASP/ASP.Net Read My Blog


MARK THE POST AS ANSWER IF IT HELPS U.


"Success doesn't come to you…you go to it."--Marva Collins




"Success does not come to those who wait . . . and it does not wait for anyone to come to it." Anonymous


0
raghav_khunger
11/5/2008 10:10:45 AM

 and one more?

your first line is 

cmd.ExecuteNonQUery();

your second line is

SqlCommand cmd = new SqlCommand("SELECT LASTUSED FROM MRISEQ WHERE UPPER(SEQID)='CASEID'", conn);

 

you are declaring variable in second line and using it in firstline. How is it possible?

 

 


Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
0
ramireddyindia
11/5/2008 10:26:58 AM
Reply:

Similar Artilces:

Compiler Error Message CS1002; expected
Can anyone tell me why this is erroring out? <title><b>User:</b><%Response.Write (Request.ServerVariables("LOGON_USER"))%></title>  Add a semicolon at the end.. <%Response.Write (Request.ServerVariables("LOGON_USER"));%> Alternativley you could write<%= Request.ServerVariables("LOGON_USER") %> in which case a semicolon is not required. amar  Adding this code I get  Compiler Error Message: CS0118: 'System.Web.HttpRequest.ServerVariables' is a 'property' but is used l...

Compiler Error Message: CS1003: Syntax error, ':' expected
hent..." : "slett..."%>Hi, i have error in the belowed statement. It says " CS1003: Syntax error, ':' expected" If any body help me, It would be grateful.. Thanks in advance.   Compiler Error Message: CS1003: Syntax error, ':' expectedSource Error: Line 28: <td style="border:1;"><%# Eval("Person")%></td> Line 29: <td style="border:1;"><%# Eval("ass")%></td> Line 30: ...

Compiler Error Message: The compiler failed with error code1.
 Hi all, I just installed the software which was fine and no errors... when i went to run it first time at local host it came up with the following error... anyone know what this means?? I have created different ASP.NET projects and it runs no problem... Regards Sicose Server Error in '/PortalVBSDK' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: The compiler failed...

Compiler Error Message: The compiler failed with error code -1073741502
Hi all, I am posting this just in case this information is useful for other people. I have an ASP.Net page created with VS2005 worked perfectly when running in release mode, but it consistently gave me the following error when running in debug mode within VS2005: Compiler Error Message: The compiler failed with error code -1073741502  The problem was solved after restarting VS.Hong Hi, I appreciate that you share your experience here. Thanks, ThomasThomas SunMicrosoft Online Community SupportPlease remember to click “Mark as Answer” on the post that helps you, and to click...

Compiler Error Message: The compiler failed with error code 128.
 I have deployed my website to a server hosted by a hosting company. (WebHost4life). I keep getting an error message when I try to access the web application via the assigned URL. Does anyone know what the problem is? Why am I getting this error message and how do I fix it? Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: The compiler failed with error code 128...

Compiler Error Message: The compiler failed with error code 128
I recently installed the .net framework 1.1 to one of my IIS servers. I have been running the .net and some of the starter kits on my dev box and it works just great. In addition to trying the time tracking starter kit (which also works great on my dev box), I have tried a very simple test.aspx page. I would appreciate any help or direction on what to do about this. I am new to .net and not even sure what to try to resolve this problem Thanks in advance. -Bob Server Error in '/TTWebVBVS' Application. ----------------------------------------------------------------------...

Compiler Error Message: CS1026: ) expected
Hi,I am new to ASP.Net. I developed a page using ASP.Net (C#). I got the follwing error, here it is along with the code. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1026: ) expectedSource Error: Line 54: </div> Line 55: </div> Line 56: <div class="ddot_app_right_area_tools_print"><asp:imagebutton id="PRINT" onclick="window.print();" Runa...

Compiler Error Message: CS1026: ) expected
I get this error message when I run a page: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1026: ) expected Source Error: Line 63: Line 64: objDataAdapter.Fill(objDataSet, "[Order]"); Line 65: DataView objDataView = new DataView(objDataSet.Tables"[Order]"); Line 66: Line 67: if (Page.IsPostBack) Source File: c:\inetpub\wwwro...

Embedded SQL compile
When I enter embedded SQL in a script with errors (invalid column names, etc.) the compile is not giving any error or warning messages. I'm using 5.0.03, and while in the script painter under Design -> Options I have checked every box for displaying errors and warnings, but still I get nothing. I know at home it will display warning for me, so it must be something I've set incorrectly, but I don't know what. If you could reply via e-mail I would appreciate it, as I have limited access to the internet here in the office. --Thanks In article <NSkFogHG#GA.159@...

Compiler Error Message: CS1026: ) expected
I want to put a hyperlink with the following code, but it display the error--Compiler Error Message: CS1026: ) expected, PLEASE CAN ANYONE HELP ME?? <ItemTemplate> <asp:HyperLink runat="server" NavigateUrl='<%#"product.aspx?productID="DataBinder.Eval(Container, "DataItem.ProductID")%>' ID="Hyperlink1"> <%# DataBinder.Eval(Container, "DataItem.CategoryName") %> </asp:HyperLink> </ItemTemplate> and CODE BEHIND::: namespace Ecommerce { /// <summary> /// Summary description...

Compiler Error Message: BC30203: Identifier expected.
Hi all, Getting this error on line 12 of my source code, it's only a simple example and I think the code is right, but I can't figure out whats causing it. Compiler Error Message: BC30203: Identifier expected. Line 10: Dim objRdr As OleDbDataReader Line 11: Line 12: objConn = New OleDbConnection( _"Provider=Microsoft.Jet.OleDb.4.0;" & _"Data Source=C:\finalyearproject2\" & _"projectallocation.mdb") Line 13: objCmd = New OleDbCommand("SELECT * FROM project_descriptions", objConn) Line 14: objConn.Open() Her...

Compiler Error Message: CS1026: ) expected #2
Hi I hope someone can help with a compiler error message as follows   <asp:HyperLink ID="HyperLink1" runat="server" Height="29px" NavigateUrl='<%# String.Format("Eval("Hyper")?Telecomitaccno={0}&BUSINESSSTREAM={1}&Dealer={2}", Eval("Telecomitaccno"), Eval("BusinessStream"), Eval("Dealer")) %>' The hyperlink is designed to evaluate a hyperling value from a table and then navigate to it carrying forward three items of information. The hyperlink works carrying the three pieces o...

compiler error message using SQL statement
Hi! I am connecting to two databases in my application through Database painter: 1. using ODBC to MS Access 2. using OLE DB to MS SQL (As active connection) I have created different transaction for each connection in my script. Problem: When I compile my script with some SQL statements, where I indicate the necessary transaction (USING transaction), I have compiler error message that in SQL statement (whose use the ODBC connection) it can't find some table using OLE DB ! When I change active connection to ODBC, I reach s...

Web resources about - Compiler Error Message: CS1002: ; expected - asp.net.sql-datasource

Compiler - Wikipedia, the free encyclopedia
... , or external linking . The most common reason for wanting to transform source code is to create an executable program. The name "compiler" ...

Compiler - Wikipedia, the free encyclopedia
"Compile" and "compiling" redirect here. For the software company, see Compile (publisher) . For other uses, see Compilation . This article has ...

Facebook Open-Sources HipHop PHP Compiler Software
Earlier this morning, Facebook officially made their new PHP “compiler,” called HipHop, available as open source software. In the blog post by ...

Art in the Age of Matter Compilers
jurvetson posted a photo: Sheba may be the harbinger of art in the digital age — a mathematical sculptor with digital matter. She manipulates ...

Interpreters and Compilers (Bits and Bytes, Episode 6) - YouTube
This animation explains the difference between interpreters and compilers. It is from Episode 6 of the classic 1983 television series, Bits and ...

Typesafe cofounder forking Scala compiler
The main contributor to the Scala compiler, Paul Phillips, has announced on GitHub that he is forking the compiler to “fix some of the innumerable ...

Does Apple's new developer agreement ban Adobe's Flash-to-iPhone compiler?
Given that any kind of formal truce between Apple and Adobe was essentially blown out of the water by Steve Job's very public slating of Flash ...

Apple seeds devs with Safari 5.2 for Lion, Xcode 4.4 with new LLVM compiler
... to the general public this summer. Among the new features: According to Apple, Xcode 4.4 includes an editor for Collada 3D files, compiler support ...

NVIDIA and Continuum Analytics Announce NumbaPro, A Python CUDA Compiler
... are announcing that they are bringing Python support to CUDA. Specifically, Continuum Analytics’ will be introducing a new Python CUDA compiler, ...

IntelliJ Releases IDEA 12, Brings Improved UI, New Compiler Mode, Android UI Designer, And More
I'm not going to pretend to be a developer here, and I'll openly admit that the bulk of what IDEA 12 does is over my head. However, I do understand ...

Resources last updated: 2/4/2016 11:12:06 PM