function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
balajibondarbalajibondar 

How to access salesforce.com database using c#webapplication

Hi ,
I have joined salesforce.com newly
I have undergone through all the document for accesing salesforce database.
i have written one webapplication to remotly access salesforce database using C#.
but i am getting exception unable to remotly login to server .
Please provide me the following information
-procedure to connect to salesforce database
- what is endpoint url.
 
 
LMoncherLMoncher
Just mashed my first one together myself.
The first thing would be to download your wdsl and add it to your VS2005 project as a web reference.
Once past that the C# walkthough works pretty well.  Just change the writelines to label.text += "string" and make sure you have a label defined out your defalut.aspx.  You'll at least get to the "connected to the API" state.  Once there you should be able to reference the objects in the system.
VijayMoharleVijayMoharle
hi,
 
 Please  follow the link
 
 
 also search for Sample Code Walkthrough...
 
 
 
balajibondarbalajibondar
Hi ,
I am able to add wsdl file to my Webapplication and I am able to access all standard objects available to salesforce.com.
I have written following code and trying to access salesforce .com
-----------------------------------------------------------------------------------------------------------------------------------------
   private void login()
        {
          // Create service object 
          SforceService sfdc = new SforceService();
          // Invoke the login call and save results in LoginResult
          LoginResult lr = sfdc.login("username","password");
          if (!lr.passwordExpired) {
             // Reset the SOAP endpoint to the returned server URL
             sfdc.Url = lr.serverUrl;
             // Create a new session header object
             // Add the session ID returned from the login
             sfdc.SessionHeaderValue = new SessionHeader();
             sfdc.SessionHeaderValue.sessionId = lr.sessionId;
             sfdc.GetUserInfoResult userInfo = lr.userInfo;
         } else {
           Console.Writeline("You password is expired.");
         }
       } 
--------------------------------------------------------------------------------------------------------------------------------------  
But my problem is that
It is giving error as unable to connect to remote server
will anybody help me regarding to this ,
bye.
 
 
balajibondarbalajibondar

I am not able to access salesforce database by using following code .Its giving exception as "unable to connect to remote server "

will anybody help me regarding to this so that i can access the database .

-------------------------------------------------------------------------------------------------------------------------------  

 private void login()
        {
          // Create service object 
          SforceService sfdc = new SforceService();
          // Invoke the login call and save results in LoginResult
          LoginResult lr = sfdc.login("username","password");
          if (!lr.passwordExpired) {
             // Reset the SOAP endpoint to the returned server URL
             sfdc.Url = lr.serverUrl;
             // Create a new session header object
             // Add the session ID returned from the login
             sfdc.SessionHeaderValue = new SessionHeader();
             sfdc.SessionHeaderValue.sessionId = lr.sessionId;
             sfdc.GetUserInfoResult userInfo = lr.userInfo;
         } else {
           Console.Writeline("You password is expired.");
         }
       }
----------------------------------------------------------------------------------------------------------------------

SuperfellSuperfell
You are likely being block by your local networks firewall and/or proxy server requirements, i suggest you contact your local network admin.
balajibondarbalajibondar

Hi Simon,

Thank u for reply and suggesting the solution .

Now i am able to access database .

My next question is that "how can i integrate my web app with salesforce by creating dll and other stuff"

Thank you .


 

SuperfellSuperfell
import the WSDL, etc, see the quickstarts and/or the docs, which walk you through getting started.
GL_NSGL_NS
Hi ,
 
I am trying to login to Salesforce from my .Net application.I am able to login to salesforce and access the Objects.
Now I want to redirect to one of my Salesforce Page from cs page with some sessionId or UserId and Pwd combination so that it should not take me to the Login page but to automatically login and show me the requested page.
 
Any suggestions?
 
Thanks in Advance...
SuperfellSuperfell
search for frontdoor.jsp
GL_NSGL_NS
Hi Simon,
 
Thanks a lot....It works :smileyhappy:
ChallengeChallenge

Hi,

       I'm new to salesforce.com application user. Basically i want to insert a record through my WCF service into salesforce database. I don't know from where to start. I've Apex explorer which give sales force query. Can you please pass me steps to connect to Salesforce database and insert records into salesforce DB. I would appreciate if any one post sample application you've developed in C# also fine i can catch up from there.

 

Really i'll be thankful for that. It is very urgent to kick of my project.

 

thanks in advance.

--Challenge

SuperfellSuperfell
see the getting started section of the API docs.
ChallengeChallenge

thanks for your response. But can you guide me like quick start to connect to salesforce DB and how to use queries. I would appreciate if you could send snippet of code. I've very less to show pilot application as demo.

 

Thanks in advance

SuperfellSuperfell
http://www.salesforce.com/us/developer/docs/api/index_CSH.htm#sforce_api_calls_create.htm
ChallengeChallenge
cool. Can you tell me from where we can get this reference SFDCWsdl.Salesforce_WSDL. Correct me if my assumption is wrong. Basically the code you've sending user id and password to login into salesforce DB and creating one account with the help of xml document. without xml document is it possible to insert records like getting users input.
 
Thanks in advance.
wandaschmickwandaschmick

Wow, this thread is cool, the post are informative and helpful specially in the field of database.  Thank you for the post.

 

-------------

Software Development

PradipPradip

Hi – I am having the same problem of accessing SalesForce database. What was the setting you made to get it connected ?

 

Thanks,

Pradip