Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CASE like T-SQL Statement?
Message
 
To
16/07/2003 11:47:58
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00810234
Message ID:
00810706
Views:
9
Cant tell you how many times I've done this yesterday.

string lc... =

This is a long term client where I put in about 2+ hrs a week over the past few years. It's an SBT base and lots of custom add ons that make life easier outside of SBT. Currently I'm doing a Fax/Email app for the colections department. Bring up a customer and see all outstanding invoices in a grid. Tag the ones you want sent, and click the process button.

Client just got a server based fax system so I'm doing this now.

__Stephen


>I haven't done too much VFP stuff lately, but we did develop a little DBA utility to set up our SQL Server database, to apply updates to it, to create SP's etc, and it was written in VFP (simply because I wrote it a year and a half ago before I was fluent in C# and so it was easier). I had to make some modifications to it a few weeks ago. It's amazing how many times I kept sticking a ; at the end of my VFP statements. <g>
>
>~~Bonnie
>
>
>>Yep, This week I'm at a VFP client and not doing .NET work.
>>
>>It's fun to keep going back and forth.
>>
>>__Stephen
>>
>>>You're welcome , Stephen ... I assume you're talking about the switch case?
>>>
>>>
>>>>Thanks Bonnie. That may do it?
>>>>
>>>>>Stephen,
>>>>>
>>>>>T-SQL supports CASE ... check it out in BOL. I guess I'm unclear as to whether you're wanting this in a Stored Proc or in your C# code. From the looks of what you've posted here, it looks like you're trying to form a SQL command to pass to your backend maybe? (I don't do it this way, as I always use SP's ... but that's another topic <g>).
>>>>>
>>>>>Anyway, C# has a case statement ... it's called "switch case" and (you can look it up in help, but ...) the syntax is:
>>>>>
>>>>>switch (expression)
>>>>>{
>>>>>    case constant-expression :
>>>>>        //code here
>>>>>        break;
>>>>>
>>>>>    // however many case statements you need
>>>>>
>>>>>    // the default is optional
>>>>>    default :
>>>>>        // code here
>>>>>        break;
>>>>>}
>>>>>
>>>>>
>>>>>
>>>>>Not sure if this helps or not, but I gave it my best shot. <g>
>>>>>
>>>>>~~Bonnie
>>>>>
>>>>>
>>>>>>Thanks Bonnie.
>>>>>>
>>>>>>I am not at their site right now but its kind of like this in foxpro:
>>>>>>lcstring = iif(ddlist1.SelectedText = "LEFT","L.H.",iif(ddlist1.SelectedText = "RIGHT","R.H.",.....))+" "+ ddlist2.SelectedText +" "+ ........
>>>>>>
>>>>>>So a Case like statement in a T-SQL command is what I'm trying to do. I'm going to be using the StringBuilder too.
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Stephen,
>>>>>>>
>>>>>>>Maybe I'm being particularly dense today, but I don't understand what you're asking. Could you elaborate more?
>>>>>>>
>>>>>>>~~Bonnie
>>>>>>>
>>>>>>>
>>>>>>>>I need to build a string for a WebForm display. I have a need for a CASE statement to take the display from a drop down and concatinate it ie:
>>>>>>>>LEFT = L.H. RIGHT = R.H.
>>>>>>>>
>>>>>>>>I am combining 7 different dropdowns for this user request, and this is the sticking point I have so far.
>>>>>>>>
>>>>>>>>Any ideas?
>>>>>>>>
>>>>>>>>TIA
>>>>>>>>
>>>>>>>>__Stephen
Previous
Reply
Map
View

Click here to load this message in the networking platform