473,508 Members | 2,038 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 1079
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**************@TK2MSFTNGP10.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
1968
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...
10
1240
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...
2
1351
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...
2
8868
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...
2
4900
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...
8
2166
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...
3
1474
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...
3
1772
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...
6
1510
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...
0
7226
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,...
0
7328
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,...
0
7388
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...
1
7049
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...
0
7499
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...
0
5631
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,...
0
4709
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...
0
3199
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...
0
1561
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 ...

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.