View Single Post

   
  #8 (permalink)  
Old 02-28-2008, 10:10 AM
Jerry Stuckle
 
Posts: n/a
Default Re: Problem with create procedure

Ted wrote:

<snipped good stuff to save electrons>

>
> When I do something similar, with data from an MS SQL Server 2005
> database, changing the value in one control results in the items in
> the other control (a drop down list) are changed. The principle
> difference is that the code for data from MS SQL Server involved
> testing for equality of integers while this code looks for records in
> which one column contains a string that itself contains the string
> provided in the parameter.
>
> In the sample ASP.NET 2 code above, the controls are properly created,
> but the dropdown lists never get any of the data that ought to have
> been returned by the SQL statement.
>
> Thanks,
>
> Ted
>


Hi, Ted,

I don't do ASP.NET, but I (think I was) able to understand your code.

A couple of things:

In your stored proc, 'ss' should be in single quotes since it's text
(sorry - missed that before).

Also, in your SELECT statement for SqlDataSource2, what would be in @ss?
You're doing a LIKE statement looking for text within a column of
text, so it should be something like

'%i want this%'

Also, since it's a string, SQL indicated it should be within single
quotes, as indicated above.

Also, I don't see where you are checking for any errors from MySQL. I
don't know how to do it in ASP.NET - but you should always be checking
the results for any errors. In PHP, for instance, the result for a
query is false when it fails, and mysql_error() retrieves the error text.

Other than that I don't see anything wrong with your code. And since
you've gotten similar to work with integers, it may just be the missing
single quotes.

One of these days I'm going to have to learn ASP.NET. But I'm still
stuck maintaining some VBScript sites :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote