473,748 Members | 2,552 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
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8252
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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

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.