I'm trying to construct a T-SQL statement with a WHERE clause determined by an input parameter. Something like:
SELECT * FROM table
WHERE id IN
CASE WHEN @param THEN
(1,2,4,5,8)
ELSE
(9,7,3)
END
I've tried all combination of moving the IN, CASE etc around that I can think of. Is this (or something like it) possible?
...
Hi,
What are better parameter to encode some image on iphone with ffmpeg??
I read that .mov and codec MJPEG are most speed really??
Now my program is very slow, with 1/5fps get a video with most low quality in 7 second.
What is codec more speed? and your parameter?
best regards
...
i have an application, and in my urls.py i have something like that:
urlpatterns = patterns('',
url(r'^profile_view/(?P<id>\d+)/$',
profile_view,
name='profile_view'),)
meaning that the profile_view function has id as a parameter.
Now, i want to call that functio...
Hello guYz plz help me out in making it possible to open the files by the adress provided in an array of strings.........
a way to open file is as given below...
ifstream infile;
infile.open("d:\aslam.txt");
but how can i open file providing an array of string as an adress of file.....
like this
infile.open(arr[i]); (but its not worki...
I have a program that generates graphs using different multi-level models. Each multi-level model consists of a generation of a smaller seed graph (say, 50 nodes) which can be created from several models (for example - for each possible edge, choose to include it with probability p).
After the seed graph generation, the graph is expande...
Hello,
I have an exe file that accpets parameters. For example,
a.exe parameter1 parameter2 parameter3
the problem is that I am not sure what parameters areavailable. Is there a way to find out it? the exe is complied by visual c++.
Thanks.
...
BACKGROUND
Am writing a WinForm app that uses the SSRS Report Viewer control to render reports in local mode - there is no SSRS server involved at all
I can successully create and execute reports in local mode
What I want to do is add Parameters to the report
THE PROBLEM
When the Report Viewer control executes a report in local mod...
I have an advanced function in PowerShell, which roughly looks like this:
function Foo {
[CmdletBinding]
param (
[int] $a = 42,
[int] $b
)
}
The idea is that it can be run with either two, one or no arguments. However, the first argument to become optional is the first one. So the following scenarios are po...
Hi,
I would like to get validation messages for validation controls from resource files. I know I can do that easily by following code snippet.
<%$ Resources:[filename prefix,]resource-key %>
or
<asp:Label ID="Label1" runat="server" meta:resourcekey="resource-key-prefix" />
But I would also like to parameterized it.
e.g.
Above R...
How to execute a stored procedure with a nullable parameter in c#?
EDIT:
Actually, I've written below code. As you can see, status parameter is a nullable value type.
Is it correct? or not?
public void LoadAll(DataTable tb, int? status=null)
{
try
{
using (SqlConnection connection = new SqlConnection()...
I have visual studio 2008 and I am designing a web site that is using the report viewer in local mode. The language that I am using is VB. I created a report using the wizard and I am using a stored procedure in SQL2008 that takes in two parameters (two date type parameters: startdate and enddate). In the wizard, the following is how I ...
I'm looking to show a ColorBox Dialog, using the code
$(document).ready(function()
$(".colorbox_dialog").colorbox();
});
When the url parameter ?dialog=yes is passed. How can I do this in jQuery 1.3+?
...
I would like to be able to be doing this :
<ObjectDataProvider x:Key="dataProvider"
ObjectInstance="uiRoot:App.Current.Controller"
MethodName="GetMyViewModel">
<ObjectDataProvider.MethodParameters>
<system:Int32>{Binding Id}</system:Int32>
</ObjectDataProvi...
I have many params making up an insert form for example:
x.Parameters.AddWithValue("@city", City.Text)
I had a failed xss attack on the site this morning, so I am trying to beef up security measures anyway....
Should I be adding my input params like this?
x.Parameters.AddWithValue("@city", HttpUtility.HtmlEncode(City.Text))
Is the...
Assuming the parameters are all the same type, is there a rule of thumb in regards to the number of parameters for a method? Im just wondering where I should draw the line and what my alternatives are (ie interface, array, etc).
...
In entity framework I have an Entity 'Client' that was generated from a database. There is a property called 'Account' it is defined in the storage model as:
<Property Name="Account" Type="char" Nullable="false" MaxLength="6" />
And in the Conceptual Model as:
<Property Name="Account" Type="String" Nullable="false" />
When sel...
The example below may not be problematic as is, but it should be enough to illustrate a point. Imagine that there is a lot more work than trimming going on.
public string Thingy
{
set
{
// I guess we can throw a null reference exception here on null.
value = value.Trim(); // Well, imagine that there is so much ...
From what I can see, SubSonic 2.x stored procedure parameter data types can only be of type System.Data.DbType.
Is there a quick way to add System.Data.SqlDbType so we can use System.Data.SqlDbType.Structured to pass tables - ultimately to TVP's?
In this particular project, all data caller functions are accessed through StoredProcedu...
I have read the question here: http://stackoverflow.com/questions/2229389/is-it-problematic-to-assign-a-new-value-to-a-method-parameter. However it is not clear to me if doing something like:
public void myMethod(Object obj) {
doSomething(obj);
obj = getNewObj();
}
or:
public void anotherMethod(Object obj) {
obj = doSomet...
Hi!
Trying to get the grips of best URI practice in RESTfulness...
Let's say that
/service/user.xml returns an xml with all users data
/service/user/1.xml returns an xml with data for user id 1
What if I want to get just the email address of the user(s)?
/service/user.xml?par=email or /service/user/email.xml for all users?
/servic...