Compiler Error Message: CS1502: The best overloaded method match for 'bpoInfo.bpoInfo(int)' has some invalid arguments
Source Error:
|
here is the 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;using
System.IO;using
System.Data.SqlClient;using
System.Text;using
System.Collections.Specialized;public
partial class BPOCompSalesListings : System.Web.UI.Page{
bpoInfo bpo =
new bpoInfo(RequestID); string strRequestID; 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["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 dataloadControls();
}
}
// 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 =
new bpoInfo(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
}
}
any ideas?
cdogPosted Apr 5, 2007, 11:30 PM
Compiler Error Message: CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
Scott LyslePosted Apr 5, 2007, 10:56 PM
Once last thing to try; in the code where it says this:
bpo = new bpoInfo(...
comment out that line and on the next line, key in "bpo = new bpoInfo(" and then stop, you should see the list of arguments for the object's constructor. What are they?
cdogPosted Apr 5, 2007, 10:43 PM
Scott LyslePosted Apr 5, 2007, 10:37 PM
Line 66: bpo = new bpoInfo(Request.QueryString["RequestID"]);
try something like bpo = new bpoInfo(5);
It would be interesting to see what it comes back with.
cdogPosted Apr 5, 2007, 9:59 PM
Scott LyslePosted Apr 5, 2007, 9:51 PM
cdogPosted Apr 5, 2007, 9:19 PM
Scott LyslePosted Apr 5, 2007, 9:15 PM
Dim bpo As bpoInfo <- right click on the red part, and select go to definition.
cdogPosted Apr 5, 2007, 9:08 PM
Dim
bpo As bpoInfoI know it is a big task can you help?
Scott LyslePosted Apr 5, 2007, 9:06 PM
bpoInfo accepts an Integer value as its only argument; you are passing it a string.
Line 64: try
Line 65: {
Line 66: bpo = new bpoInfo(Request.QueryString["RequestID"]);
See if this does not help out:
string sBpo = Request.QueryString["RequestID"];
if(sBpo != string.Empty)
{
int iBpo = Convert.ToInt32(sBpo);
bpo = new bpoInfo(iBpo);
}
Scott LyslePosted Apr 5, 2007, 9:00 PM