473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cannot implictly convert type 'char' to 'string'

This is what I want to do:

int currentWord = 0;
currentWord++;
textBoxOtherLang.Text = orginalLanguage[currentWord];

But, I get a "Cannot implictly convert type 'char' to 'string'"
error when trying to do it. How do I fix it?

Thanks!

================
Davor Babic´
----------------
da****@comhem.se

Nov 15 '05 #1
4 12780
<ciach>
textBoxOtherLang.Text = orginalLanguage[currentWord].ToString();

--
Selvin - Przemek Sulikowski
se****@osadkowski.com.pl
Nov 15 '05 #2
Selvin wrote:
<ciach>
textBoxOtherLang.Text = orginalLanguage[currentWord].ToString();


Thanks! You people here at microsoft.public.dotnet.languages.csharp
are sooo smart! ;-P

--
Davor Babic´
----------------
da****@comhem.se

Nov 15 '05 #3
Hi Davor,

textBoxOtherLang.Text = orginalLanguage[currentWord].ToString();

or you can always use the Convert class:

textBoxOtherLang.Text = Convert.ToString( orginalLanguage[currentWord] );

the latter expression just call ToString() :)

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Davor" <da****@comhem.se> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
This is what I want to do:

int currentWord = 0;
currentWord++;
textBoxOtherLang.Text = orginalLanguage[currentWord];

But, I get a "Cannot implictly convert type 'char' to 'string'"
error when trying to do it. How do I fix it?

Thanks!

================
Davor Babic´
----------------
da****@comhem.se

Nov 15 '05 #4
Davor <da****@comhem.se> wrote:
This is what I want to do:

int currentWord = 0;
currentWord++;
textBoxOtherLang.Text = orginalLanguage[currentWord];

But, I get a "Cannot implictly convert type 'char' to 'string'"
error when trying to do it. How do I fix it?


Well, what exactly are you trying to do? What is the type of
orginalLanguage, and what are you expecting to see on the screen?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Terminal882003 | last post by:
Hi, Here I have a question about MSCommLib. I need to dynamically add activeX controls that requires run-time license for MSCommLib. The following is the actual code: AxMSCommLib.AxMSComm...
1
by: Svyatoslav | last post by:
Hi, I have a problem with XmlNodes and my stack. It looks something like this: //declarations XmlNode node, new_node; Stack MyStack = new Stack(); //code MyStack.Push(node);
22
by: Christoph Boget | last post by:
I am getting an error (a few among many) for the following lines of code: retval.BrokerName = (( curRow == System.DBNull.Value ) ? SqlString.Null : (string)curRow ); retval.BrokerGroupId = ((...
2
by: Patrick Olurotimi Ige | last post by:
When i convert:- this code from VB to C# Why do i get error "Cannot implicitly convert type 'object' to 'bool' VB --- If cmdcommand.Parameters("ReturnValue").Value = 1 Then lblStatus.Text =...
9
by: Andy Sutorius | last post by:
Hi, I am receiving the error when compiling the project, "cannot implicitly convert type object to string". The error points to this line of code and underlines the dtrRecipient:...
3
by: Patrick Olurotimi Ige | last post by:
compiling the code below i get the error:- Cannot implicitly convert type 'object'to 'System.Xml.XmlDocument' I'm getting the error on this line:- myXml.Document =...
1
by: alex21 | last post by:
Ok i am trying to use a Linq query to access a dictionary. public static Dictionary<string, Client> Clients = new Dictionary<string, Client>();Using this Linq query: IEnumerable<Staff> loginquery...
2
by: ransaj | last post by:
objCompanyRequirement.Salary = Convert.ToInt32 (txtCRF_Salary.Text); cannot implicitly convert type 'int' to 'string' objCompanyRequirement.InterviewDate = ...
3
by: sappyjosh | last post by:
public void Update_Stock(Inseed Is) { if (con.State == ConnectionState.Open) { con.Close(); } try { ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.