As LINQ-to-SQL can call stored procs, you could have a stored proc that takes an array as a input then puts the values in a temp table to join on likewise by taking a string that the stored proc splits Or upload all the values to a temp table yourself and join on that table. However maybe you should rethink the problem: Sql server can be configured to allow query against tables in other databases (including oracle), if you are allowed this may be an option for you. Could you use some replication system to keep a table of trip numbers updated in DB2?
Thanks, the temp table idea is fantastic and works perfectly. The only worry I have is having concurrent users using the system at once may cause issues, although I have an idea of storing the user's username with the trip number in the temporary table – Chris May 25 at 12:31 @chris, "Local temporary tables are visible only in the current session", as there is a different session for each Ado. Net connection you should be OK with a "Local temporary table".
– Ian Ringrose May 25 at 12:48.
You may split your query or use a temporary table in database2 filled with results from database1.
Not sure whether this will help, but I had a similar issue for a one-off query I was writing in LinqPad and ended up defining and using a temporary table like this. Table(Name="#TmpTable1") public class TmpRecord { Column(DbType="Int", IsPrimaryKey=true, UpdateCheck=UpdateCheck. Never) public int?
Value { get; set; } } public Table TmpRecords { get { return base.GetTable(); } } public void DropTable() { ExecuteCommand( "DROP TABLE " + Mapping. GetTable(typeof(T)). TableName ); } public void CreateTable() { ExecuteCommand( typeof(DataContext) .
Assembly . GetType("System.Data.Linq.SqlClient. SqlBuilder") .
InvokeMember("GetCreateTableCommand", BindingFlags. Static | BindingFlags. NonPublic | BindingFlags.
InvokeMethod , null, null, new { Mapping. GetTable(typeof(T)) } ) as string ); } Usage is something like void Main() { List ids = .... this.Connection.Open(); // Note, if the connection is not opened here, the temporary table // will be created but then dropped immediately. CreateTable(); foreach(var id in ids) TmpRecords.
InsertOnSubmit( new TmpRecord() { Value = id}) ; SubmitChanges(); var list1 = (from r in CustomerTransaction join tt in TmpRecords on r. CustomerID equals tt. Value where .... select r).ToList(); DropTable(); this.Connection.Close(); } In my case the temporary table only had one int column, but you should be able to define whatever column(s) type you want, (as long as you have a primary key).
Too many parameters were provided in this RPC request. The maximum is 2100. Var dept_ids = string.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.