473,748 Members | 2,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot implicitly convert to 'System.Windows .Forms.ColumnHe ader'

70 New Member
hi all
i m creating a window application and i used a listview control in a window's form. But when i try to build that application then the following error prompts :

Cannot implicitly convert type 'string' to 'System.Windows .Forms.ColumnHe ader'

i m not able the understand what is the problem.
Feb 15 '07 #1
3 18565
crabbypatties
1 New Member
hi all
i m creating a window application and i used a listview control in a window's form. But when i try to build that application then the following error prompts :

Cannot implicitly convert type 'string' to 'System.Windows .Forms.ColumnHe ader'

i m not able the understand what is the problem.
I had the same problem. One of my columns was named "Name". I changed it to "Name_col" and the problem disappeared. Using "Name" conflicted with an existing member.
Apr 2 '07 #2
SammyB
807 Recognized Expert Contributor
hi all
i m creating a window application and i used a listview control in a window's form. But when i try to build that application then the following error prompts :

Cannot implicitly convert type 'string' to 'System.Windows .Forms.ColumnHe ader'

i m not able the understand what is the problem.
Please show us the line of code and several lines before & after. It sounds like you just need to use the Text property.
columnHeader1 = "Desc" would give you that error. Use
columnHeader1.T ext = "Desc"
Apr 2 '07 #3
Wint
1 New Member
Please show us the line of code and several lines before & after. It sounds like you just need to use the Text property.
columnHeader1 = "Desc" would give you that error. Use
columnHeader1.T ext = "Desc"
I got this error too, it was choking on the this.name = "frmMain"; line when initializing the windows form. Turns out a control inside that form, a ListView, had a column that I had named "Name". Changing that to something else allowed the project to build without errors. Any idea why?
Mar 1 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2882
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 mscomm = new AxMSCommLib.AxMSComm(); string strLicense = "gfjmrfkfifkmkfffrlmmgmhmnlulkmfmqkqj";
22
27892
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 = (( curRow == System.DBNull.Value ) ? SqlInt32.Null : (int)curRow ); The errors are (in turn):
6
14378
by: juli | last post by:
I declared: public delegate void PaintEventHandler(object objSender,PaintEventArgs pea); and this.Paint+=new PaintEventHandler(MyPaintHandler); and the: static void MyPaintHandler(object objSender,PaintEventArgs pea) { }
9
10529
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: objMailMessage.To = dtrRecipient; I'm not sure why I am getting this error. Below is the complete code I am working with.
3
6069
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 = getXML("http://www.crn.com.au/rss.aspx?SCID=9"); Any ideas?
7
1681
by: Alex | last post by:
Hi, I'm completely new to C#, so here is my question: Why my C# program (COM dll which I can call from C++ application) cannot see namespace System.Windows.Forms.. When I'm typing in "using System..." after the System. the only "W"
0
2269
by: Qiang | last post by:
Anybody knows how to convert convert System.Windows.Forms.HtmlDocument to String? Any API or sample code will be greatly appreciated. thanks, Qiang
2
4496
by: ransaj | last post by:
objCompanyRequirement.Salary = Convert.ToInt32 (txtCRF_Salary.Text); cannot implicitly convert type 'int' to 'string' objCompanyRequirement.InterviewDate = Convert.ToDateTime(txtCRF_InterviewDate.Text); cannot implicitly convert type 'System.DateTime' to 'string'
4
25383
by: clflyer | last post by:
I have a small problem. I'm pretty much a newbie to C# coming out of VB.Net. I have a windows form that has a GroupBox named grpSoldTo. I want to be able to clear all the textboxes and comboxes that are in the GroupBox. I know how to do it in VB.Net but when I try something similar in C# I get the following error: Cannot implicitly convert type 'System.Windows.Forms.Control' to 'System.Windows.Forms.ComboBox'. An explicit conversion...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9332
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.