Solved

Failed to create component, The column name is not valid error in visual studio

Posted on 2009-03-29
3
707 Views
Last Modified: 2013-12-17
I'm getting the error:
Failed to create compnonent 'Test'.  The error mesage follows:
'The column name is not valid. [ Node name (if any) = , Column name = Paid ]'

What I'm trying to do is load a user control into a tabbed form.  It's not creating the component in the design view and gives me this error.  I've rebuilt the database and the typed data sets and everything is fine with the column in question.  I can even run my program and it works fine.  I need to get into design view for some formatting issues and am concerned that this could be causing other problems if I don't fix it.

I'm using Visual Studio 2008 and SQL Server 2005.  Any help with this error would be greatly appreciated.
0
Comment
Question by:deloused
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
djon2003 earned 500 total points
ID: 24015565
I think that you are loading from database within the constructor of this usercontrol (the New method).

I'm suggesting you to change to loading from database from New to a method named Loading.. call this Loading in the Load event of the usercontrol.

Of then shall be able to put your control within designer view.
0
 

Author Comment

by:deloused
ID: 24018114
I'm not sure if this helps but I've attached the code I'm working with now.  I think I'm already loading from the Load event.  I'm very new to windows apps, so I  appreciate any guidance.




protected override void OnLoad(EventArgs e)
        {
            BindData();
        }
 
public void BindData()
        { 
			ProjectOne.ProjectOneDatabaseDataSet.RecordNumberDataTable RecordNumberTable = new ProjectOneDatabaseDataSet.RecordNumberDataTable();
            RecordNumberTable = recordNumberTableAdapter.GetData();
 
            try
            {                  
				this.recordNumberTableAdapter.Fill(this.projectOneDatabaseDataSet.RecordNumber);
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
		}

Open in new window

0
 
LVL 9

Expert Comment

by:djon2003
ID: 24018610
Could you try by adding this condition ?
protected override void OnLoad(EventArgs e)
        {
            if (this.DesingMode == false) BindData();
        }

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

809 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