Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gridview NULL criteria not showing
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
01498857
Message ID:
01500656
Vues:
42
Naomi,

I have finally gotten back to trying out your suggestion. I have integrated the code from the message you linked below into the "OnSelecting" attribute of the datasource in question as follows:
 protected void SqlEquip_Selecting(object sender, SqlDataSourceCommandEventArgs e)
    {

        SqlParameterCollection myCollection = (SqlParameterCollection)e.Command.Parameters;

        IEnumerator ie = myCollection.GetEnumerator();
        string strSQL = string.Empty;
        while ((ie.MoveNext()))
        {
            SqlParameter param = (SqlParameter)ie.Current;
            string strValue = string.Empty;
            if (param.Value == null)
            {
                strValue = "NULL";
            }
            else
            {
                strValue = param.Value.ToString();
                strSQL += param.ParameterName.ToString() + "=" + strValue + "<BR />";
            }

        }

        Response.Write(strSQL.ToString()); 
    }   
 
and the "parsed parameters" for the stored procedure have the following values:
		@upsino=%<BR />@sub_name=%<BR />@co_equipno=%<BR />@serial_no=%<BR />
This still doesn't tell me why records with a NULL value in any one of the last three fields are excluded from the result set. The sql command that is run from the stored procedure is listed below in our earlier post.

Thank you so much.



>>Unfortunately I am running SQL Server Express 2008 R2.
>>
>Took me a bit while to find this thread
>
>How to get printed SQL command that was passed Thread #1370295 Message #1370295
>
>In this thread I give a link to an answer by limno as how to get the command passed to SQL Server using only .NET code (when you don't have Profiler).
>
>Hope this helps.
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform