473,662 Members | 2,596 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changes in SQL tables and databinding

Bob
I had a SQL server 2005 table in which I noticed I mispelled a column name.
I changed the column name in the sql server table but after that, in the UI
fortm using the table, the dataset control bound via a binding source and a
table adapter to a datagridview no longer recognized the changed column name
and kept giving me an error on that column, evidentlty I expect that is
normal.
But only way I found to fix and see my changed column was to remove the
datagridview using it and all its associated controls (dataset, etc..) and
create a brand new datagrid with its associated dataset binding source and
table adapter.

Questions is there must be a simpler way to effect changes in the objects
related to databinding controls in the UI when a change is brought to the
underlying SQL server tables. How do you get these controls to get the new
table definitions without having to reprogram your entire form?

Any help appreciated,

Bob
Dec 28 '05 #1
3 1087
Hi

Based on my understanding, you have a SQL Table and binding to the
DataGridView.
Now you want to change one column name in SQL Table and you did not want to
change the code.

So far I did not know in what extent did you reference the column name in
your program.
But here is an approach you may have a try.
e.g.
You have a column Name: fname and code your program.
Now you want to change the Column Name to EmployeeName.

1. Open the dataset designer by doubleclick the xsd file in the solution
explorer.
2. right click on the TableAdapater and click configurate
3. Change the Select statement to employeeName from fname because we have
change that in SQL Table
4. Save, and the Table mapping in Dataset Designer will be changed into
employeeName
5. to apply the original name, please change the employeeName back to fname
6. Save and rebuild the solution.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 29 '05 #2
Bob,

It is much improved in Version 2005 comparing with Versions 2003 and before.
In those you had to start new when you used the designer (and therefore it
was probably hardly used, I will be curious what it will be with the new
one, however that looks much better because you can recreate your table by
adding columns and changing names in the XSD dataset etc (the retrieving
commands are now in the dataset it self))..

I am really curious if the way Peter shows work, I would not know why not.
However, maybe can you reply if you succeeded with that.

Thanks,

Cor
Dec 29 '05 #3
Bob
Thank you both, I will test this immediately and give you a reply on how
well it worked.
Bob
"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:eB******** ******@TK2MSFTN GP10.phx.gbl...
Bob,

It is much improved in Version 2005 comparing with Versions 2003 and
before. In those you had to start new when you used the designer (and
therefore it was probably hardly used, I will be curious what it will be
with the new one, however that looks much better because you can recreate
your table by adding columns and changing names in the XSD dataset etc
(the retrieving commands are now in the dataset it self))..

I am really curious if the way Peter shows work, I would not know why not.
However, maybe can you reply if you succeeded with that.

Thanks,

Cor

Dec 29 '05 #4

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

Similar topics

2
1992
by: Newbee Adam | last post by:
how to save textbox values to 2 tables using sqladapter I am new with this. Do I need to ADO.net? what is the simplist correct way? or can I write a query in my vb.net form insert table Machine_Count(MachName, CoinsIn) values(txtMachineName(1).Text, txtCoinsIn(1).Text)
10
1250
by: Matthew Workman | last post by:
I have one aspx page where i am databinding two drop down lists based on a dataset (the data is being loaded from an XML Document). The fields get updated properly, no problem there. My question is: "How do you handle the events so that if the user chooses an option in the drop down, it poulates the cooresponding value in the second drop down?" I have been splitting hairs on this, and I am at a point that I need some help from the...
2
1357
by: Geir Sanne | last post by:
hi!! how am i supposed to update the db witht he changes the user make in webpage am trying to make a simple page that have a grid bound to a table the user can delete,add or update the grid how do i get the changes into the database
2
8875
by: Bennett Haselton | last post by:
I know how to create a DataAdapter that loads data from a data source into a table in a typed DataSet, and how to set the DataSource and DataMember properties of a DataGrid so that at run time it will load the data from that table in the DataSet. Assuming I've got two tables in the DataSet, how can I set the DataSource property of the DataGrid to be an inner join of the two tables in the DataSet? If I want the DataGrid to get data...
2
4915
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is being updated by some other process through remoting. When the page loads, I init the tree, and in my browser I can see the initialized tree. The problem is that every time that I receive update to tree from the remote process,
8
2175
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got answered... In 1.1 we always did our own myDataAdapter.fills and we liked that control for lots of good reasons. Now the new DataSource (or is it a TableAdapter:Dataset) automatically fills the Gridview. How can we control that fill? In a...
3
1496
by: Steve Teeples | last post by:
I am new to database work. I have a very simple database with only two tables linked by a 1:1 relationship. I've read the tables contents into a dataset and bound the two tables to textbox controls on a form. Using a BindingNavigator I can cursor through the data. However, I don't understand how to properly update new data entered within my form. I was able to get the parent table to update correctly but never the child table. Fact...
3
1777
by: meeraguna | last post by:
We have 20 -30 normalized tables in our dartabase . Also we have 4 tables where we store the calculated data fron those normalised tables. The Reason we have these 4 denormalised tables is when we try to do the calcultion on the fly, our site becomes very slow. So We have precalculated and stored it in 4 tables. The Process we use to do the precalcultion, will get do the calculation and and store it in a temp table. It will compare...
6
1520
TonFrere
by: TonFrere | last post by:
Hello, I'm simply trying to keep track of changes on a windows form as users modify control values. I created a boolean variable called IsDirty and want it set to true whenever the user changes something. The problem is: where to set IsDirty to true? If I raise the event on "TextChanged" event of a control (let say a textbox), it is set to true whenever the user changes current record. I also tried to raise it on "Validating" event but...
0
8435
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
8345
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
8857
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...
1
8547
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
8633
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
7368
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
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.