473,756 Members | 3,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ObjectDataSourc e and DataSet Update Query Creation

I have my SQL database with a table that I am trying to have a
gridview dislay with inline editing.
It seems as if the dataset does not generate the apropriate update
query, and therefore consequently the gridview does not automatically
allow editing.

I then try to change which update query that is selected being the
dataRow, DataSet,dataTab le or other DataRow[] And none of them work
(upon update i get an error about the first field whatever it may be)

It seems to generate the insert query ok but not the update.

I also looked at the code of the dataset and see select and insert but
no update.

I decided that I would try and have it create stored procedures then
i looked at the script to create them, I clicked "copy all" and this
is what the dataset creation wizard was going to complete. Note the
lack of update or delete.

IF EXISTS (SELECT * FROM sysobjects WHERE name = 'SelectChecksBy Loss'
AND user_name(uid) = 'dbo')
DROP PROCEDURE dbo.SelectCheck sByLoss
GO

CREATE PROCEDURE dbo.SelectCheck sByLoss
(
@LossID bigint
)
AS
SET NOCOUNT ON;
SELECT aut_id, txt_check, dat_Date, txt_Payee, mny_Medical,
mny_Transport, mny_Maintenance , mny_UnearnedWag es, mny_Settlement,
mny_OtherCosts,
mny_LegalFees, mny_AdjusterFee s, mny_Expense,
dat_DateofServi ce, txt_Description , mny_Reimburseme nt
FROM tbl_LossChecks
WHERE (ulk_loss = @LossID)
GO

IF EXISTS (SELECT * FROM sysobjects WHERE name = 'InsertCheck' AND
user_name(uid) = 'dbo')
DROP PROCEDURE dbo.InsertCheck
GO

CREATE PROCEDURE dbo.InsertCheck
(
@txt_check nvarchar(255),
@dat_Date datetime,
@txt_Payee nvarchar(255),
@mny_Medical float,
@mny_Transport float,
@mny_Maintenanc e float,
@mny_UnearnedWa ges float,
@mny_Settlement float,
@mny_OtherCosts float,
@mny_LegalFees float,
@mny_AdjusterFe es float,
@mny_Expense int,
@dat_DateofServ ice datetime,
@txt_Descriptio n nvarchar(255),
@mny_Reimbursem ent float
)
AS
SET NOCOUNT OFF;
INSERT INTO [tbl_LossChecks] ([txt_check], [dat_Date], [txt_Payee],
[mny_Medical], [mny_Transport], [mny_Maintenance],
[mny_UnearnedWag es], [mny_Settlement], [mny_OtherCosts],
[mny_LegalFees], [mny_AdjusterFee s], [mny_Expense],
[dat_DateofServi ce], [txt_Description], [mny_Reimburseme nt]) VALUES
(@txt_check, @dat_Date, @txt_Payee, @mny_Medical, @mny_Transport,
@mny_Maintenanc e, @mny_UnearnedWa ges, @mny_Settlement ,
@mny_OtherCosts , @mny_LegalFees, @mny_AdjusterFe es, @mny_Expense,
@dat_DateofServ ice, @txt_Descriptio n, @mny_Reimbursem ent)
GO

Any help would be greatly appreciated

Apr 24 '07 #1
0 1605

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

Similar topics

0
1115
by: Scott R | last post by:
I have a data layer that is set up to pass datasets to and from the presentation layer. In migrating to 2.0, I would like to use the objectdatasource. The problem I am having is that it seems that objectdatasource update will not pass a dataset back to the update function as a parameter. Specifically, this is what I'm trying to do. Function Contact_Select(ByVal _contactid As Integer) As dataset
7
3469
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is null going back into the stored procedure. I'm stumped and would greatly appreciate any suggestions.
5
1927
by: Dabbler | last post by:
What is the best way to handle data interpolation between form controls and the actual sql data field. I have radio buttons that need to be interpreted, form values that have to be translated.. e.g. if (tbDaysDriveAlone.Text > 0) sb.Append( @"drive\"); if (tbDaysVanPool.Text > 0) sb.Append(@"vanPool\"); if (tbDaysCarpool > 0) sb.Append(@"Carpool\"); myObjectInstance.CommuteMethod = sb.ToString(); Should this be done in an event method...
0
1459
by: Phil | last post by:
Environment: XP sp2 VS.Net 2005 (Asp.Net 2.0 - c#) Sql Server 2005 Scenario: -Table (Table1) with two columns: Table1Id <- Primary Key Column1
10
4577
by: J055 | last post by:
Hi I've been trying out SqlCacheDependency using the ObjectDataSource and SQL Server 2005. It all works quite well with the minimum of configuration, e.g. <asp:ObjectDataSource ID="odsAccounts" runat="server" ... EnableCaching="true" SqlCacheDependency="CommandNotification"> .... </asp:ObjectDataSource>
0
1428
by: Angel | last post by:
I created a Dataset Type on one project which generates a DLL. I have a web project . I created a webpage with a gridview. I attached an ObjectDatasource to the Dataset type from my other project. I assigned the Insert, Update, and select to the ObjectDataSource. I attached the gridview control to the ObjectDataSource. I run it and edit a record in the grid. When I hit the update, I get the following error: ...
5
2656
by: Randy Smith | last post by:
Hi ALL, I wonder if anyone has been using n-tier to bind to a GridView control by using the ObjectDataSource. This is our first OOP web application, and we have no tables. Right now we are simply working with objects in memory. So, it appears as though Microsoft requires that our datamapper classes reside inside a folder called "App_Code", and NO WHERE ELSE. So, has anyone successfully been able to place their datamappers in a...
5
2176
by: cmrchs | last post by:
Hi, I'm trying out Databinding to a Data Acces Layer using a ObjectDataSource-control The Update works fine but the Delete-method doesn't. when debugging I see that my productID-parameter is always 0 and not the ID of the selected record (which is the case when updating) How come?
3
4365
by: semomaniz | last post by:
I have a ajax reorderlist that displays the contents with out any problems but when i drag and reorder the list nothing happens, i get a postback and the same initial list is displayed, seems like my update method is not working or being called. I have read through multiple articles that states that all the parameters needs to be passed in if objectdatasource is being used, I followed the instructions that i could get through google none worked...
0
9255
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
10014
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...
0
9844
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9689
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
8688
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
5119
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
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3326
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2647
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.