473,586 Members | 2,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validate FormView fields C#

Title says it ... my C# web application uses a number of FormViews that are
inserted/updated/deleted via stored procedures.

Is there a way thru C# coding (example?) to validate a date field as valid
input before inserting/updating? Test the length of a varchar/char field?
Validate an int field as valid numeric input (no alpha) ... and so on?

I would like to do this validation before the stored procedures fire
(perhaps stopping), of course so the user does not see the cryptic messages
that come back by default.

It would be nice to see some C# examples or the specifics on another
workarounds. Thanks to all you pros for reading.
Jun 27 '08 #1
0 1391

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

Similar topics

8
6161
by: Ottar | last post by:
I have a few numeric fields, and when I update i get the error: "Input string was not in a correct format". Next line:" System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2178925" This is beacuse some of my TextBoxes are empty (no value). If I enter a value it...
1
1259
by: TdarTdar | last post by:
I wanted to add three columns up on the form and run some logic to fill in the third but not sure how to call the field names in the formview control. Dim Girth As Integer Elenght = (Me.FormView1.lengthTextBox.text * 2) this shows an error of couse, what is the new correct way to do this using MS formview data control?
0
2193
by: Metal2You | last post by:
I'm working on an ASP.NET 2.0 application in Visual Studio 2005 that accesses a Sybase database back end. We're using Sybase SQL Anywhere 9.0.2.3228. I have installed and registered the Sybase .NET 2.0 DataProvider (iAnywhere.Data.AsaClient.dll) into the GAC so it can be used in the ProviderName property of a SQLDataSource and loads properly...
2
8736
by: P. Yanzick | last post by:
Hello, I am creating an edit template for a FormView control, changing one of the textboxes to a dropdown box. The dropdown will be populated from a simple table with the primary key, and a description (i.e. a colors table, so there is a colors ID and a color description). The data source the FormView is pulling data from stores (in this...
7
4340
by: Lorenzino | last post by:
Hi, I have a problem with bindings in a formview. I have a formview; in the insert template i've created a wizard control and inside it i have an HTML table with some textboxes bound to the sqldatasource of the formview. If i put this textboxes outside the table everything works well, but as soon as i put them inside the table (in order to...
0
1099
by: boomhauer | last post by:
Hi, Im using a lot of formview's in my asp.net app, and it gets a bit frustrating to tie a datasource to the formview and have it generate the labels and fields for the datasource, to only then have to go hand-edit eveything to arrange the fields how I want them. Ive poked around in the formview to see if there is a way to overrid the...
1
1364
by: Uriah Piddle | last post by:
Hi, I have a FormView where nothing gets rendered past the opening <ItemTemplatetag. The FormView Header renders but nothing else. If I put garbage in an Eval statement, no errors are raised and the page loads but, of course, with no data in the FormView. If I put a div inside the ItemTemplate, it does not render. In Design view, my...
0
1644
by: John Mason | last post by:
Hi, I've been trying for most of the day to get a FormView control to work. I would like to display a single record, based on a unique user id (loginid), which I am retreiving from a cookie. No paging involved. I want to give the user the ability to edit their record and update it (no insert). I pre-populate the database fields with...
0
1090
by: COHENMARVIN | last post by:
I have a sqldatasource and a formview. I bind the formview to the sqldatasource, and hope that automatically the fields of the select statement in the datasource will appear in the itemtemplate of the formview. For instance, if my stored procedure that is referenced by the sql data source returns a lastname and a firstname, I want to see two...
0
7839
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...
0
8200
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. ...
0
8338
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...
1
7954
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...
0
8215
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...
0
6610
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...
1
5710
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...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.