Parameter Array
Posted: Thu 21 Feb 2008 06:40
Hi All
I have the following data adapter selectcommand:
SELECT * FROM game_type WHERE game_type_id IN (@game_type_list) AND (deleted=0) ORDER BY game_type_name asc
I want to pass an array to this list with comma separated values ie
Obviously, this does not work as its passing a string to a int type, but I cant use varchar type either as this is an int type column in the table.
The SQL query that I am trying to replicate would look like this:
SELECT * FROM game_type WHERE game_type_id IN (1,2,3) AND (deleted=0) ORDER BY game_type_name asc
How can I do this with a parameter?
Nick
I have the following data adapter selectcommand:
SELECT * FROM game_type WHERE game_type_id IN (@game_type_list) AND (deleted=0) ORDER BY game_type_name asc
I want to pass an array to this list with comma separated values ie
Code: Select all
MySqlDataAdapter_game_type.SelectCommand.Parameters.Add("@game_type_list", CoreLab.MySql.MySqlType.BigInt, 20).Value = "1,2,3"
The SQL query that I am trying to replicate would look like this:
SELECT * FROM game_type WHERE game_type_id IN (1,2,3) AND (deleted=0) ORDER BY game_type_name asc
How can I do this with a parameter?
Nick