Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、Users テーブルに属する一意の ID のセットがあります。1478、8906、4677 など。DataAdapter を使用して、これらのユーザーの完全なレコード セットを含む DataSet を取得するにはどうすればよいですか?
ID が文字列変数にカンマで区切られている場合、たとえば SQL Server を使用している場合は、次のことができます。
SqlDataAdpater apd=new SqlDataAdapter("Select * from Users where UserId in("+users+")",new sqlconnection("connection info") DataSet ds=new DataSet() adp.fill(ds)
whereは、カンマ区切り形式の のusersリストを含む変数ですId
users
Id