[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1792
  • Last Modified:

COMPILATION ERROR C# Compiler Error Message: CS1513: } expected

I am getting the following message with the attached .cs code.  It is stating that line 58 is expecting "}".  Any help would be appreciated.
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MelQuery2 : System.Web.UI.Page
{
    decimal AssignedTotal = 0;
    decimal CompletedTotal = 0;
    decimal DeferredTotal = 0;


	protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
	{
	if (e.Row.RowType == DataControlRowType.DataRow)
        {
            // add the Assigned and Completed and Deferred to the running total variables
           // AssignedTotal += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Assigned"));
         //   CompletedTotal += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Completed"));
        //    DeferredTotal += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Deferred"));

   
   object ro = DataBinder.Eval(e.Row.DataItem, "Assigned");
   if(ro != DBNull.Value)
   {
      AssignedTotal += Convert.ToDecimal(ro);
   }
   object rt = DataBinder.Eval(e.Row.DataItem, "Completed");
   if(rt != DBNull.Value)
   {
       CompletedTotal += Convert.ToDecimal(rt);
   }
   object rt = DataBinder.Eval(e.Row.DataItem, "Deferred");
   if(rt != DBNull.Value)
   {
       DeferredTotal += Convert.ToDecimal(rt);
   }
     
        else if (e.Row.RowType == DataControlRowType.Footer)
        {
            e.Row.Cells[7].Text = "Sub Totals:";http://manager.laxpm.com/mel/MelQuery2.ASPX
            // for the Footer, display the running totals
            e.Row.Cells[4].Text = AssignedTotal.ToString("##.#");
            e.Row.Cells[5].Text = CompletedTotal.ToString("##.#");
            e.Row.Cells[6].Text = DeferredTotal.ToString("##.#");
            
            e.Row.Cells[1].Text = "OT/Rate - %";
			Decimal otrate= (CompletedTotal)/(AssignedTotal;
			e.Row.Cells[2].Text = otrate.ToString("0.0%"); 
 
            e.Row.Cells[3].HorizontalAlign = e.Row.Cells[6].HorizontalAlign = HorizontalAlign.Center;
            e.Row.Font.Bold = true;                             
 
       }
    }
    
    }

Open in new window

0
BOEING39
Asked:
BOEING39
2 Solutions
 
guru_samiCommented:
you need } at line 39
0
 
lazyberezovskyCommented:
Nope.
You need two things:
1) '}' at line 59
2) ')' at line 49
0
 
BOEING39Author Commented:
Both answers were partially correct.  Thank you.

Needed Brace"}" on line 39 and Paren ) on line 49 thx.......
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now