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

Home Posts Topics Members FAQ

Automatically generating Update and Delete commands

JJ
Hi All,

is there a limit to the size of an update or delete command that
a data adapter will automatically create. I have just added another
varchar field to my table and when I attempt to now add the modified
data adapter to my form the wizard informs me that it can not
generate the code for the update and delete commands. If I
remove the newly added field and attempt to add the new
data adapter (after removing the existing one) then everything
appears to work fine. There is nothing special about the table,
or the newly added field.

Any ideas, or do I know have to create all of the sql commands
by hand.

I tried to add a da from the data tool box (instead of dragging
the table from the database) and get the wizard to generate
stored procedures as well, but this came back with the same error.

The SP for the SELECT command is
ALTER PROCEDURE dbo.usp_SelectC omplaint
AS
SET NOCOUNT ON;
SELECT pID, pcID, pDate, pDetails, pOriginator, pStat FROM
tblComplaint
So as you can see it's not too taxing.

The insert command can be generated. The SP for that is
ALTER PROCEDURE dbo.usp_InsertC omplaint
(
@pcID int,
@pDate datetime,
@pDetails varchar(250),
@pOriginator varchar(50),
@pStat char(10)
)
AS
SET NOCOUNT OFF;
INSERT INTO tblComplaint(pc ID, pDate, pDetails, pOriginator, pStat)
VALUES (@pcID, @pDate, @pDetails, @pOriginator, @pStat);
SELECT pID, pcID, pDate, pDetails, pOriginator, pStat FROM
tblComplaint WHERE (pID = @@IDENTITY)
Which, once again is reasonably straight forward.

Thanks for the help.

Jason.
Nov 20 '05 #1
1 1221
"JJ" <ja***@nospam.d ivemaster.org> schrieb

is there a limit to the size of an update or delete command that
a data adapter will automatically create. I have just added
another varchar field to my table and when I attempt to now add the


I think the ADO.Net group has been established for these kind of questions:
microsoft.publi c.dotnet.framew ork.adonet
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

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

Similar topics

16
17004
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums must be UPDATED, if not, they must be INSERTED. Logically then, I would like to SELECT * FROM <TABLE> WHERE ....<Values entered here>, and then IF FOUND UPDATE <TABLE> SET .... <Values entered here> ELSE INSERT INTO <TABLE> VALUES <Values...
4
3802
by: Oscar Thornell | last post by:
Hi, I have a relativley large/complex typed dataset that contains 7-8 tables and some supporting relational tables (lookups) for many-to-many relations. A good exampel would be a dataset that contained the whole Northwind database with all tables and relations. In my business logic I will retrive a populated instance of the dataset and perform some operations (adding/deleting/updating of rows in various tables...).
4
2146
by: Jonathan Upright | last post by:
Greetings to anyone who can help: I'm using WebMatrix to make ASP.NET pages, and I chose the "Editable DataGrid" at the project selector screen. As you may know, it defaults to the Microsoft SQL database "pubs". I've followed the instructions in the comments and also changed everything pertaining to SQL over to OLEDB. (i.e. Changed SqlDbType. to OleDbType.) I also changed the datafield names and variable names accordingly. The page...
1
282
by: JJ | last post by:
Hi All, is there a limit to the size of an update or delete command that a data adapter will automatically create. I have just added another varchar field to my table and when I attempt to now add the modified data adapter to my form the wizard informs me that it can not generate the code for the update and delete commands. If I remove the newly added field and attempt to add the new data adapter (after removing the existing one) then...
3
1792
by: RJN | last post by:
Hi I'm using the Dataadapter and Dataset to do an insert/update/delete into tables. The dataset has multiple tables in it. I want to write my own Update/Insert commands for the Dataadapter for each of the tables and not use the ones created by SqlCommandBuilder. The Update/Delete commands created by Command builder do not create where clause based on the primary key but the where cluase created will be based on all the columns. This...
3
2486
by: Jesse Liberty | last post by:
I created a new database (tried both in 2005 and in SQL 2000) and then created a SqlDataSource control in an asp.net application. Clicked on the smart tag and whose configure data source. When I click Advanced should see the Generate Insert, Update and Delete statements check box but it is grayed out. Any idea what might cause this? I can work around with this code, which does work: SqlDataSource1.InsertCommand = "Insert into myTable...
4
9691
by: drakuu | last post by:
Hello there, I have DataGrid with some records and I would like to edit it right in the datagrid using the built in commands. I can't figure out a way to pass to the SQL query the record ID which I'm editing. SELECT: SelectCommand="SELECT ProviderID, AddressID, Address, Address2, City, State, County, Zip FROM ProviderAddress WHERE (ProviderID = @ProviderID)"
3
1352
by: Patrick.O.Ige | last post by:
Hi guys, Is there any free stuff to generate DAL code out there? Thanks in advance
13
1875
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I am using VS2005. I created a Windows Appication project. Inside the Server Explorer, I created a new SQLExpress database, and then created a new table. I added the rows, making my first row an integer, and setting the identity property to true. I set that row to be my primary key. I then added a dataset, and added my table to the dataset. When I configure the table, I have no Update or Delete commands, even though the wizard has the...
2
1128
by: Alaashamas | last post by:
I have in project in VisualBasic .NET. This project should display,add,modify,delete the rows of the tables from SQLServer EXPRESS. For this i made a connection to the SqlServer Express through the SqlDataAdapter from the tool box. The connection wizard auto generates the code for the select command only. Code for the update, delete and insert command are not generated. "connection cannot be properly configured" is shown as error. my...
0
8432
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
8764
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...
1
8546
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
7367
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...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5654
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4180
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...
1
2762
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 we have to send another system

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.