Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
.NET
.NET Core
.NET MAUI
.NET Standard
Active Directory
ADO.NET
Agile Development
AI
AJAX
AlbertAGPT
Alchemy
Alexa Skills
Algorand
Algorithms in C#
Android
Angular
ArcObject
ASP.NET
ASP.NET Core
Augmented Reality
Avalanche
AWS
Azure
Backbonejs
Big Data
BizTalk Server
Blazor
Blockchain
Bootstrap
Bot Framework
Business
Business Intelligence(BI)
C#
C# Corner
C# Strings
C, C++, MFC
Career Advice
Careers and Jobs
Chapters
ChatGPT
Cloud
Coding Best Practices
Cognitive Services
COM Interop
Compact Framework
Copilot
Cortana Development
Cosmos DB
Cryptocurrency
Cryptography
Crystal Reports
CSS
Current Affairs
Custom Controls
Cyber Security
Data Mining
Data Science
Databases & DBA
Databricks
Design Patterns & Practices
DevExpress
DevOps
DirectX
Dynamics CRM
Enterprise Development
Entity Framework
Error Zone
Exception Handling
F#
Files, Directory, IO
Flutter
Games Programming
GDI+
General
Generative AI
GO
Google Cloud
Google Development
Graphics Design
Graphite Studio
Hardware
Hiring and Recruitment
HoloLens
How do I
HTML 5
Infragistics
Internet & Web
Internet of Things
Ionic
Java
Java and .NET
JavaScript
JQuery
JSON
JSP
Knockout
Kotlin
Langchain
Leadership
Learn .NET
Learn iOS Programming
LINQ
Machine Learning
Metaverse
Microsoft 365
Microsoft Fabric
Microsoft Office
Microsoft Phone
Microsoft Teams
Mobile Development
MongoDB
MuleSoft
MySQL
NEAR
NetBeans
Networking
NFT
NoCode LowCode
Node.js
Office Development
OOP/OOD
Open Source
Operating Systems
Oracle
Outsourcing
Philosophy
PHP
Polygon
PostgreSQL
Power Apps
Power Automate
Power BI
Power Pages
Printing in C#
Products
Progress
Progressive Web Apps
Project Management
Public Speaking
Python
Q#
QlikView
Quantum Computing
R
React
React Native
Reports using C#
Robotics & Hardware
RPA
Ruby on Rails
RUST
Salesforce
Security
Servers
ServiceNow
SharePoint
Sharp Economy
SignalR
Smart Devices
Snowflake
Software Architecture/Engineering
Software Testing
Solana
Solidity
Sports
SQL
SQL Server
Startups
Stratis Blockchain
Swift
SyncFusion
Threading
Tools
TypeScript
Unity
UWP
Visual Basic .NET
Visual Studio
Vue.js
WCF
Wearables
Web API
Web Design
Web Development
Web3
Windows
Windows Controls
Windows Forms
Windows PowerShell
Windows Services
Workflow Foundation
WPF
Xamarin
XAML
XML
XNA
XSharp
Register
Login
3
Answers
beginner woes
cdog
17y
2.4k
1
Reply
This is probably an easy fix but I can not for the life of me find what is causing this error. I am translating a monster
vb
.net to c# script and this is the latest error:
Compiler Error Message: CS1513: } expected
Source Error:
Line 91: }
Line 92:
Line 93: void SaveComps() {
Line 94: private string Result;
Line 95: private string Source;
Here is my code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class BPOCompSalesListings : System.Web.UI.Page
{
private string bpo;
private string strRequestID;
private string ProductCode;
private void Page_Load(object sender, System.EventArgs e) {
Helper.checkSession(Session, Page);
if (!(Request.QueryString["PRODUCT"] == null)) {
ProductCode = Request.QueryString["PRODUCT"];
}
strRequestID = Request.QueryString["RequestID"];
ClientScript.RegisterClientScriptInclude("autosave", "scripts\\autosave.js");
ClientScript.RegisterStartupScript(this.GetType(), "myAutoSave", "AutoSaveInit(600000);", true);
string script = "function SubmitFormToBeSaved() { " + ClientScript.GetPostBackEventReference(btnSubmit, "") + "; } ";
ClientScript.RegisterClientScriptBlock(this.GetType(), "autosave", script, true);
if (!Page.IsPostBack) {
if (!(strRequestID == null)) {
if (loadBPO(true)) {
// ensure we have fresh data
loadControls();
}
}
// Make sure the brokerinfo matches the current lmc working on the assignment
// Helper.setBrokerInfo(Request.QueryString("RequestID"))
// ClientScript.RegisterStartupScript(Me.GetType(), "
popup
", "
javascript
:window.showmodaldialog('ValidateBPO.aspx', '', ''", True)
// ClientScript.RegisterStartupScript(Me.GetType(), "popup", "ShowPopup('ValidateBPO.aspx')", True)
btnOk.Visible = false;
PanelExtraValidation.Visible = false;
ButtonComment.Attributes.Add("onclick", "javascript:alert(\'Submitting form for approval.\');");
}
}
private bool loadBPO(bool refreshBPO) {
// force new bpo if none exists or we just saved data
// If Session("bpo") Is Nothing Or refreshBPO Then
try {
bpo = (Request.QueryString["RequestID"]);
}
catch (Exception ex) {
Session["exceptionMessage"] = ex.Message;
DisplayError("LoadBPO\\", (ex.Source + (" " + ex.Message)));
return false;
}
// Session("bpo") = bpo
// Else
// bpo = Session("bpo")
// If Not bpo.BPOID = Request.QueryString("RequestID") Then
// Try
// bpo = New bpoInfo(Request.QueryString("RequestID"))
// Catch ex As Exception
// Session("exceptionMessage") = ex.Source + " " + ex.Message
// DisplayError("LoadBPO\", ex.Source + " " + ex.Message)
// Return False
// End Try
// Session("bpo") = bpo
// End If
// End If
return true;
}
private void loadControls() {
// we load/unload screen by visual grouping/order
LoadPropertyInfo();
LoadPropertyCharacteristics();
LoadComps();
}
void LoadComps() {
LoadSale1();
LoadSale2();
LoadSale3();
LoadList1();
LoadList2();
LoadList3();
}
void SaveComps() {
private string Result;
private string Source;
if (!SaveSale1(Result)) {
Source = "Save Sale 1: ";
DisplayError(Source, Result);
}
// sale 1
if (!SaveSale2(Result)) {
Source = "Save Sale 2: ";
DisplayError(Source, Result);
}
// sale 2
if (!SaveSale3(Result)) {
Source = "Save Sale 3: ";
DisplayError(Source, Result);
}
// sale 3
if (!SaveList1(Result)) {
Source = "Save List 1: ";
DisplayError(Source, Result);
}
// list 1
if (!SaveList2(Result)) {
Source = "Save List 2: ";
DisplayError(Source, Result);
}
// list 2
if (!SaveList3(Result)) {
Source = "Save List 3: ";
DisplayError(Source, Result);
}
// list 3
}
}
I can not seem to find the cause, any help would be appreciated
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
VB Translation
vb.net to c# translator?