Salesforce API - getting error :-'sforce.sObject' does not contain a definition for 'Any'

Salesforce API - getting error  please help.

 

Compiler Error Message: CS0117: 'sforce.sObject' does not contain a definition for 'Any'

Source Error:

Line 68: 
Line 69:                 sforce.sObject con = qr.records[0];
Line 70:                 string fName = con.Any[0].InnerText; 
Line 71: 
Line 72:              //   lead = qr.records[0];

Code

private void querySample()

{

sforce.
sObject lead;

int i;

sforce.QueryResult qr = sfdc.query("select name from lead");for (; true;)

{

for (i = 0; (i <= qr.records.Length); i++)

{

lead = qr.records[i].ToString();

// lead = qr.records[0];

 

// lead.Id.

Response.Write(lead.Any[0].InnerText + "<br>");

// lead.

// Response.End();

//Console.WriteLine(lead.Any(0).InnerText);

}

 

if (qr.done)

{

break; //Warning!!! Review that break works as 'Exit Do' as it could be in a nested instruction like switch

}

qr = sfdc.queryMore(qr.queryLocator);

}


Dost
My website
0
visliCom
11/20/2008 6:56:31 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

1 Replies
763 Views

Similar Articles

[PageSpeed] 36

http://community.salesforce.com/sforce/profile?user.id=32728

http://community.salesforce.com/sforce/board/print?board.id=NET_development&message.id=6783&page=1&format=page 


We All move to our original place.
Don't forget.

Imran Baloch
0
imran_ku07
11/21/2008 5:05:51 AM
Reply:

Similar Artilces:

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Error 39 'System.Data.DataRow' does not contain a definition for 'Item'
for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) { categoryID = ds.Tables[0].Rows[i].Item["categoryID"]; name = ds.Tables[0].Rows[i].Item["name"]; string catID = Convert.ToString(categoryID); ///Change made by me ddlCategory.Items.Add(new ListItem(name, catID)); qry = "Select count(categoryID) from categories where active = 'True' AND parentID=" + categoryID + ""; countCategories = objDB.getScalar(qry);       i get this errorIf the going seems easy, You are going DownHill... I've got the solution what you have to ...

ERROR: 'object' does not contain a definition for 'methodName'
I have a class and a page. The class has a method called RetrieveImage(int idx). In the Page_Load event, I called the RetrieveImage(3). example: Page_Load() {   ImagePrint objImage = new ImagePrint();   objImage.RetrieveImage(3);} I get the error CS0117: 'ImagePrint' does not contain a definition for 'RetrieveImage'   what am I missing? any clue would be appreciated. I'm still stuck. Is your ImagePrint class in the same namespace as the Page class that is trying to use it? NC...   No. The ImagePrint is a class inside the App_Code directory under a ...

Error: 'Object' does not contain a definition for 'object__field'
The problem is as follows. I'm trying to reduce the number calls I'm making into the SalesForce API. Currently, I use 3 calls to obtain the fields I need from the Account Object.  Here are the three methods I'm using: private string getContactId(string selfServiceUserName)    {        QueryResult qr = null;         sfdc.QueryOptionsValue = new QueryOptions();        sfdc.QueryOptionsValue.batchSize = 1;        sfdc.Query...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

'''
Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this fee...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

table_info('','','','%') cannot return any types
I was recently confirming table_info special cases and discovered the case for getting table_types cannot work. table_info('','','','%') should return a list of table types but it returns a list of empty strings instead: my @types = $h->tables('', '', '', '%'); print "all types:\n", join("xxx\n", @types), "\n"; # should output something like: # "dbo" # "INFORMATION_SCHEMA" # "sys" # and actually outputs: xxx xxx It seems to be down to the following ...

error in ''%'' operator
hi... friends    i got this error (Syntax error: Missing operand after ''%'' operator)below statement. dtBtnScr.DefaultView.RowFilter = "LOCATION_CITY'" + txtCity.Text.Trim() + "%'AND LOCATION_STATE '" + ddlState.SelectedValue + "%'AND UNIT_ID'" + txtUnitCode + "%'AND UNIT_NAME '" + txtUnitName.Text.Trim() + "%'";   thnax friends It thinks you are trying to use the modulo operator: %. Look at the RowFilter string after you build it ...you should see the prob...

error CS1579: foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'
Hi,I tried samples on preventing javascript injection attacks tutorial(http://www.asp.net/learn/mvc/tutorial-06-cs.aspx) and while executing i am getting this error. d:\DotNet\MVCapplication\MvcApplication1\MvcApplication1\Views\Home\Index.aspx(23): error CS1579: foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'Pls suggest me.   The problem is this line in the tutorial code: foreach (Feedback feedback in ViewData.Model) You either need to cast ViewData.Model ...

Give access to non virtual folder through configuration entry? ERROR: <location> path attribute must be a relative virtual path. It cannot contain any of '?' ':' '\' '*' '"' '<' '>' or '|'.
I have a webpage running under a virtual directory that is mapped to d:/webapplication that produces an excel spreadsheet, the page calls a library object that generates a report and places it in a folder d:/attachments. This folder is not in the virtual directory. When I access the webpage i click a button and it attemps to return the created spreadsheet as a mim content type application/vnd.ms-excel. However i getting redirected back to the login page of the application. Ive also noticed that the excel spreadsheet has not even been created at this location. So assuming this...

Error 'CrystalReport' does not contain a definition for 'DataDefnition' Please Help
Why am I getting this error 'CrystalReport' does not contain a definition for 'DataDefnition' 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; using CrystalDecisions.ReportSource; using CrystalDecisions.CrystalReports.Engine;   public partial class CrystalReport : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } p...

'object' does not contain a definition for 'Reaction'
Hi,,the following code shows the error, 'object' does not contain a definition for 'Reaction' if (objError.Reaction==0) { throw; } plz solve this issue Thanks   Post the code of objError. Looks like reaction is not defind there.ASP.NET Hosting (HostingFest)...

'CreditCard' does not contain a definition for 'GetCreditCardDetails'
In my Confirm.aspx page I am using a method from a dll. In VS 2005 sometimes when I compile my project(web site) in which the dll is a part of the solution it gives me following error,Confirm.aspx.cs(220): error CS0117: 'CreditCard' does not contain a definition for 'GetCreditCardDetails' I verified many times that the method exists. To solve the errror I have to remove the dll from the bin and give reference again. Yesterday I deployed the dll and didn't receive any error while compilation. But received error after accessing Confirm.aspx. Can someone please hel...