Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
ASP.NET 1.0/1.1
NULL e DATASET
giovedì 12 gennaio 2006 - 12.03
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
hya77
Profilo
| Newbie
16
messaggi | Data Invio:
gio 12 gen 2006 - 12:03
CIAO!
HO UNA DATAGRID A CUI è ASSOCIATO UN DATASET ,
SE NON INSERISCO NULLA IN UN CAMPO DI TIPO NUMERICO O DATA, MI VA IN ERRORE!
******************************************************
Cast non valido dalla stringa "" al tipo 'Decimal'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Cast non valido dalla stringa "" al tipo 'Decimal'.
Source Error:
Line 177: r.AVA_PROG = CType(dgi.FindControl("TxtAVA_PROG"), TextBox).Text
******************************************************
COSA DEVO FARE?
:)
Brainkiller
Profilo
| Guru
7.999
messaggi | Data Invio:
gio 12 gen 2006 - 12:43
>CIAO!
>HO UNA DATAGRID A CUI è ASSOCIATO UN DATASET ,
>SE NON INSERISCO NULLA IN UN CAMPO DI TIPO NUMERICO O DATA, MI
>VA IN ERRORE!
>******************************************************
>
>Cast non valido dalla stringa "" al tipo 'Decimal'.
>Description: An unhandled exception occurred during the execution
>of the current web request. Please review the stack trace for
>more information about the error and where it originated in
>the code.
Ciao,
devi gestire l'eccezione, prima di fare il CType devi verificare se è stato inserito qualcosa allora prosegui con il CType diversamente l'utente non ha inserito niente, o lo fermi o prosegui e inserisci nel database vuoto o null dipende da come l'hai disegnato e da che compotramento vuoi avere.
ciao
David De Giacomi
Microsoft MVP
http://blogs.dotnethell.it/david/
hya77
Profilo
| Newbie
16
messaggi | Data Invio:
ven 13 gen 2006 - 10:31
ho fatto
Try
r.AVA_PROG = CType(dgi.FindControl("TxtAVA_PROG"), TextBox).Text
Catch ex As Exception
r.AVA_PROG = vbNull
End Try
ma mette nel DB 1
HYA NON E' ROCK MA HARD ROCK!
hya77
Profilo
| Newbie
16
messaggi | Data Invio:
lun 16 gen 2006 - 10:25
AIUTATEMI PLEASE!
HYA NON E' ROCK MA HARD ROCK!
Brainkiller
Profilo
| Guru
7.999
messaggi | Data Invio:
ven 20 gen 2006 - 12:24
>ho fatto
> Try
> r.AVA_PROG = CType(dgi.FindControl("TxtAVA_PROG"),
> TextBox).Text
> Catch ex As Exception
> r.AVA_PROG = vbNull
> End Try
>ma mette nel DB 1
Che vuol dire mette nel DB 1 ?
Dov'è la query di inserimento ?
Da dove arriva il valore Uno ?
ciao
David De Giacomi
Microsoft MVP
http://blogs.dotnethell.it/david/
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !