?
Solved

Cannot convert type 'string' to 'int'

Posted on 2006-10-26
1
Medium Priority
?
201 Views
Last Modified: 2010-04-16
private int datetimeunitid;
 private int dateperiodtypeid;
       

  datetimeunitid = (int)_ds.Tables[0].Rows[0]["DateTimeUnitId"].ToString();
  dateperiodtypeid = (int)_ds.Tables[0].Rows[0]["DatePeriodTypeId"].ToString();
         
where

 public int DateTimeUnitId
        {
            get
            {
                return datetimeunitid;
            }
        }
       
        public int DatePeriodTypeId
        {
            get
            {
                return dateperiodtypeid;
            }
        }

     
0
Comment
Question by:mathieu_cupryk
[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
1 Comment
 
LVL 23

Accepted Solution

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

Try:
datetimeunitid = Convert.ToInt32(_ds.Tables[0].Rows[0]["DateTimeUnitId"]);
dateperiodtypeid = Convert.ToInt32(_ds.Tables[0].Rows[0]["DatePeriodTypeId"]);
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

766 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