Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joining data from a local datatable and a database table
Message
From
19/05/2007 03:47:20
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01226621
Message ID:
01227013
Views:
13
Thank you Viv, but i don't know how many parameters i need. That's the reason i don't send the parameter list separately.
The user creates a list of codes, and i send this list as parameters to the database.

One solution would be creating a memory DataTable internally, and then join the DataTable to the Database table. Something like this:
DataTable dt = new DataTable("Table1"); 
dt.Columns.Add("unidade"); 
DataRow dr = dt.NewRow(); 
dr["unidade"]= "1234"; 
dt.Rows.Add(dr); 
dt.AcceptChanges(); 
.
.
.
dr["unidade"]= "9999"; 
dt.Rows.Add(dr); 
dt.AcceptChanges(); 
Once i had this table i could create a select string like this:
SelectString = "select a.unidade, a.numero, a.date " +
  "from _dsa_ihs_table a, 'Table1' b" +
  "where a.unidade = b.unidade " +
  "order by a.unidade" ;
But for that i know there's no way to do this. Or there is?

Joaquim


>Hi,
>
>
>You'd need to pass the parameters in seperately:
>  "where unidade in (?,?,?,?, etc) " +"
which isn't particularly practical. Maybe pass the SParameter to a SP instead?
>Regards,
>Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform