473,406 Members | 2,345 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.

Detailsview and Displaying Errors

JJ
I have a detailsview that is used to update/insert records in my sql
database via a stored procedure.

The stored procedure returns a negative int when there is a problem - for
example a duplicate entry exists.

I can check for the return value in the objectdatasources 'OnInserted', and
I can display an error via a label control.

However, I'd like the detailsview fields to keep the erroneous entries so
the user can change them.
How can I achieve this?
Do I use viewstate?

Any pointers appreciated.
JJ
May 5 '07 #1
1 1230
JJ
In the end I used a custom validator to check for a duplicated entry before
inserting the record.
This means two trips to the database, but unless someone can suggest another
method, that will have to do.

JJ

"JJ" <ab*@xyz.comwrote in message
news:OL****************@TK2MSFTNGP02.phx.gbl...
>I have a detailsview that is used to update/insert records in my sql
database via a stored procedure.

The stored procedure returns a negative int when there is a problem - for
example a duplicate entry exists.

I can check for the return value in the objectdatasources 'OnInserted',
and I can display an error via a label control.

However, I'd like the detailsview fields to keep the erroneous entries so
the user can change them.
How can I achieve this?
Do I use viewstate?

Any pointers appreciated.
JJ

May 5 '07 #2

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

Similar topics

0
by: swethasivaram | last post by:
Hi all I am displaying some information from my database using DetailsView which is bound to SqlDataSource1. <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"...
2
by: sck10 | last post by:
Hello, I am trying to programically make the following TemplateField ("MyTemplate") visible when the user clicks on the "Edit" Button using the PreRender handle event. My question is, how do...
3
by: stuart.d.jones | last post by:
Hi, I have a DetailsView control bound to a SqlDataSource. I've got everything working nearly as I want, but here's my problem. I have a table which has a Guid as a Primary Key, and a VarChar...
5
by: Mike P | last post by:
The default format for the DetailsView control is for there to be a row per field. Is it possible set it to show more than one column per row (see below)? ID ... Name ......
1
by: loga123 | last post by:
Hi All, I am using ASP .NET 2.0. I have gridview displaying data and when a row is selected on gridview "detailsview" pops up based on the row selected from gridview. I want to make this...
0
by: loga123 | last post by:
Hi All, I have a requirement where I am using Gridview to display list of categories. When they click on a category, it opens a "detailsview" displaying the first four items that come under...
0
by: le0 | last post by:
Guys, I create a simple insertion in a database using DetailsView control, when i run this page and try to insert some data, the browser returns an error like this ...
2
by: Cas | last post by:
Hi, I use a detailsview control for inputtng data. I want to check the user input before it is sent to the database (min. /max value, not empty, only some values allowed ...). When clicking on...
0
by: Artchil Gogava | last post by:
Hi All, I am displaying a record with certain fields on the DetailsView control on the ASP.NET web page. Since the record associated with the DetailsView has lots of fields, I want to split the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...
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
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.