![]() |
| |||||||
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
| ||||
| The reason I was looking at the SP was this particular query always seems to take quite a long time to run in .NET, whereas when I tested it in the query browser it was taking less than half a second. I'm sure the delay is DB related as other queries to the same table are much quicker... |
| Sponsored Links |
| The Following User Says Thank You to Wolffy For This Useful Post: | ||
richyrich (June 11th, 2008) | ||
| ||||
| Yeah I did see that Wolffy, but wasn't sure if I could get the order of the parameters right. I assume it drops the USING values into the query in the order they are placed. I was wondering if you could do the same but name them. |
| ||||
| Yeah, now I see what you mean. I was trying to figure out a way to do this while having the same parameters in the same position regardless of query -- but that's going to make for some really inefficient queries. Take the rather simple example of your conveyor predicate: Code: IF iconveyor <> '' AND iconveyor<>'all' THEN SET _conveyor = ' AND visitors.conveyor = ?'; ELSE SET _conveyor = ' AND visitors.conveyor LIKE ?; SET @iconveyor = '%'; END IF; ![]() |
| ||||
| I think I got it sorted. No changes to my SP. In .NET used the following code to add the parameters:- Code: Dim mycommand as new mysqlcommand("clientlist",conn)
Dim isurname as MySqlParameter = mycommand.parameters.Add("isurname",mysqldbtype.varchar)
isurname.value = search.surname
Hope that helps someone... ![]() |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stored Procedures on MySQL | richyrich | MySQL | 7 | June 9th, 2008 11:15 AM |
| Parameterized Dynamic Query | Shem | .Net Development | 4 | June 6th, 2008 10:20 AM |
| If statement stored procedure | peebman2000 | SQL Development | 32 | May 23rd, 2008 03:54 PM |
| Dynamic Stored Procedure | jmurrayhead | Microsoft SQL Server | 16 | March 26th, 2008 11:19 AM |
| Sponsored Links |
| ASP.NET Resource Index a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer. Free Web Directory Including Chats and Forums Resources, Offer automatic, instant and free directory submissions. | URLZ Web Directory URLZ Web Directory Free Web Directory - Add Your Link The Little Web Directory | Free Web Directory Pegasus free web directory is a free directory organised by categories. Web Directory & SEO Services dirroot web directory |