[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Int To String Error HELP!

Posted on 2006-10-19
4
Medium Priority
?
266 Views
Last Modified: 2010-04-16
Guys when I am trying to complie this code I get an error that says "Cannot implicty convert type 'int' to 'string'.  The two highlighted things with this error message are the 0 where it says string subjectid= 0 and the word Policy where it says subjectId = policy.InsurancePolicy[0].SubjectId;
Please help need this code fixed ASAP, took over this c# project that I have no clue about..  I tried to do a Convert but it is not working for me.

string subjectId = 0;
  if (Request["S"] == null) {
    ARBilling.WebServiceProxies.InsurancePolicyInfo policy = (ARBilling.WebServiceProxies.InsurancePolicyInfo)this.DataSource;
      subjectId = policy.InsurancePolicy[0].SubjectId;
        } else {
      subjectId = Request["S"].ToString();
    }
0
Comment
Question by:gtaro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Accepted Solution

by:
CHAExchange earned 1000 total points
ID: 17766471
Try this. I put quotes around the 0 and added ToString() to subjectId = policy.InsurancePolicy[0].SubjectId

string subjectId = "0";
  if (Request["S"] == null) {
    ARBilling.WebServiceProxies.InsurancePolicyInfo policy = (ARBilling.WebServiceProxies.InsurancePolicyInfo)this.DataSource;
      subjectId = policy.InsurancePolicy[0].SubjectId.ToString();
        } else {
      subjectId = Request["S"].ToString();
    }
0
 
LVL 23

Assisted Solution

by:adathelad
adathelad earned 1000 total points
ID: 17766474
Hi,

Try:
string subjectId = "0";
  if (Request["S"] == null) {
    ARBilling.WebServiceProxies.InsurancePol<wbr/>icyInfo policy = (ARBilling.WebServiceProxies.InsurancePo<wbr/>licyInfo)t<wbr/>his.DataSo<wbr/>urce;
      subjectId = policy.InsurancePolicy[0].SubjectId.ToString();
        } else {
      subjectId = Request["S"].ToString();
    }
0
 
LVL 11

Expert Comment

by:Mihai Stancescu
ID: 17766615
You can try to use Convert.ToString(Request["S"]);

Regards,
Mishu
0
 

Author Comment

by:gtaro
ID: 17766708
Guys thanks to the both of you.  You posted the answer at the same time.  I am going to split the points.  Guys I have a quick project that I would need taken care of before 2pm PST today.  It is very simple but I do not have time to take care of it.  Basically it would be implementing this idea http://www.codeproject.com/aspnet/disableListItems.asp  I have a drop down on a web page and I want one of the options to not be selectable by the user.  There are 5 different options in the drop down that are pulled from a SQL table.  Basically one of those options can only be set if a record is imported so the user can not select this option.  If you are interested in working on this today and completing before 2pm PST please let me know. There will be a reward for this project, maybe money or a gift.  Please let me know ASAP guys if you are interested and the best way to reach you.  We can communicate throughout the day on Yahoo, AIM, or MSN

0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question