473,399 Members | 3,401 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,399 software developers and data experts.

ObjectDataSource 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,dataTable 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 = 'SelectChecksByLoss'
AND user_name(uid) = 'dbo')
DROP PROCEDURE dbo.SelectChecksByLoss
GO

CREATE PROCEDURE dbo.SelectChecksByLoss
(
@LossID bigint
)
AS
SET NOCOUNT ON;
SELECT aut_id, txt_check, dat_Date, txt_Payee, mny_Medical,
mny_Transport, mny_Maintenance, mny_UnearnedWages, mny_Settlement,
mny_OtherCosts,
mny_LegalFees, mny_AdjusterFees, mny_Expense,
dat_DateofService, txt_Description, mny_Reimbursement
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_Maintenance float,
@mny_UnearnedWages float,
@mny_Settlement float,
@mny_OtherCosts float,
@mny_LegalFees float,
@mny_AdjusterFees float,
@mny_Expense int,
@dat_DateofService datetime,
@txt_Description nvarchar(255),
@mny_Reimbursement float
)
AS
SET NOCOUNT OFF;
INSERT INTO [tbl_LossChecks] ([txt_check], [dat_Date], [txt_Payee],
[mny_Medical], [mny_Transport], [mny_Maintenance],
[mny_UnearnedWages], [mny_Settlement], [mny_OtherCosts],
[mny_LegalFees], [mny_AdjusterFees], [mny_Expense],
[dat_DateofService], [txt_Description], [mny_Reimbursement]) VALUES
(@txt_check, @dat_Date, @txt_Payee, @mny_Medical, @mny_Transport,
@mny_Maintenance, @mny_UnearnedWages, @mny_Settlement,
@mny_OtherCosts, @mny_LegalFees, @mny_AdjusterFees, @mny_Expense,
@dat_DateofService, @txt_Description, @mny_Reimbursement)
GO

Any help would be greatly appreciated

Apr 24 '07 #1
0 1576

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

Similar topics

0
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...
7
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...
5
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.....
0
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
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...
0
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....
5
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...
5
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...
3
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.