>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.
Looks like every single parameter has gotten a value of '%'. What is supposed to be returned in this case? Try running the same now in SSMS using % for each parameter.
If it's not broken, fix it until it is.
My Blog