Solved

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

Posted on 2009-03-29
3
705 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now