Solarion
Honorary Master
- Joined
- Nov 14, 2012
- Messages
- 28,051
- Reaction score
- 17,805
I have a list of account numbers
List<string> accountNumbers;
And I'm trying to find all accounts in the database in this range. So something like:
I know I'm having one of those stupid days and I just can't see it. I know it's wrong but I have no idea why.
List<string> accountNumbers;
And I'm trying to find all accounts in the database in this range. So something like:
C#:
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT [PaymentID],[Status],[Destination] FROM [Payments].[dbo].[PaymentDetails] where AccountNo in ('"+ accountNumbers + "')";
cmd.CommandType = CommandType.Text;
cmd.Connection = sqlCon;
I know I'm having one of those stupid days and I just can't see it. I know it's wrong but I have no idea why.