Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I see the parameters as I passed them to SP?
Message
De
27/05/2008 16:40:09
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01319767
Message ID:
01319801
Vues:
11
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I'm passing parameters to SP and using InsertCommand for SQLDataSource. The error coming from the SP tells me that one of the parameters is NULL, but it should not be NULL, I believe.
>
>Do you know how can I get parameters (and in which method) how they were passed to SP?
>
>Thanks a lot in advance.

Hi Naomi,

you can use the "Inserting" event of the SQLDatasource object, to check or manipulate its InsertParameters collection. This event fires right before the data will be inserted.

For example:

protected void SqlDataSource1_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
if(this.SqlDataSource1.InsertParameters[0]==null)
{
// stop the insert process
e.Cancel = true;
}
}
Holger Vorberg
Germany
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform