473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

SQL Server Triggers and Defaults not firing on Windows form.

I have a datagrid on a windows form with a bindingnavigator. The
tableadapter, bindingsource and dataset are there also.

I can browse and edit data normally.

I had added the "click" event to the "save" button on the navigator's
toolstrip.

I would like to have the data for the datagrid's table(or tables if it
is a joined recordset) to be updated to the SQL Server table that is
being displayed in the grid.

I used the following code...

private void saveToolStripButton_Click(object sender, EventArgs
e)
{
try
{
this.Validate();
this.partyBindingSource.EndEdit();
this.partyTableAdapter.Update(this.storeDataSet.Pa rty);
MessageBox.Show("Update successful");
}
catch (System.Exception ex)
{
MessageBox.Show("Update failed");
}
}
}
}

I compared my changes to the SQL table and the changes were there, but
the default values and the values on the fields set by an UPDATE
trigger did not show up.
BTW, the triggers and defaults work when editing in Enterprise Manager
or Query Analyser.

Any ideas?

Also, would this be a good place to call the "Fill" method on the table
adapter to refresh the records after the save/update? (assuming the
triggers and default values work, there would be something to see when
the refresh occurs)

TIA

Jan 14 '06 #1
0 842

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

Similar topics

5
by: Matt | last post by:
Hello I am running a SP from the SQL Server Agent, the job has one step that looks like this. exec q_spr_inlevextsystem This job fails with the following message Job 'AutoInlev' : Step...
2
by: aaj | last post by:
Hi all I have a continuous bound form and on each record is a tick box. The user ticks the boxes and these boxes define the batch. for future operations before they leave the page I count...
3
by: Mo | last post by:
Hi, I using server side customvalidator in a FormVIew insert form. It triggers and regardless of the fact if args.IsValid is true or false the data get inserted. am I missing something? ...
2
by: cefrancke | last post by:
I have a datagrid on a windows form with a bindingnavigator. The tableadapter, bindingsource and dataset are there also. I can browse and edit data normally. I had added the "click" event...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
4
by: =?Utf-8?B?QW1yaXQgS29obGk=?= | last post by:
Hello, I have a button that starts up a Thread and runs it in the background. While the Thread is running, all the Ajax controls, including the events fired by the PageRequestManager, stop...
3
by: Andy Baker | last post by:
I have an SQL Server 2005 database that is populated with a customer's data. I want to create a new database, in exactly the same format, so that I can set up a system for a potential new customer...
4
by: abcd | last post by:
here is the code ---------------------------------------------------------------------------------------- <%@ Register Src="~/UserControls/SegsUC.ascx" TagName="Segs" <asp:Panel...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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
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
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,...

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.