Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 8 May 2008 06:58:07 -0700,    group: microsoft.public.dotnet.datatools        back       


Strongly Typed Dataset accessing query using 'IN'   
This problem touches both SQL/Server and ADO.NET, and its solution could be 
in either.  A round of applause if you can provide the solution.

The goal:
Produce a stored procedure which accepts a string of options to be used in a 
SELECT WHERE <a field> IN (<the string> ) statement, AND make the resulting 
set of rows available as a strongly typed dataset.

What I’ve tried so far and why it doesn’t work:
1 – pass the string into the stored procedure, build a varchar containing 
the entire select statement, and execute that string
	Doesn’t work because VS / ADO.NET sees the ‘exec’ command, not a ‘select’ 
command, so when I drop the sProc onto the dataset page in VS2008, it becomes 
part of the QueriesTableAdapter, not its own table adapter, as if it were a 
SQL command that doesn’t return rows.

2 – use option 1 but select into a temporary table, then follow that with a 
SELECT * FROM #tempTable.
	Doesn’t work because the scope of the temporary table that the Select 
creates is limited to the ‘exec’ command, and the subsequent ‘select (*)’ 
command can’t access the temporary table.
3 – use option 2 but use a global temporary table
	Won’t work because multiple simultaneous accesses will collide, trying to 
simultaneously access the single global temporary table
date: Thu, 8 May 2008 06:58:07 -0700   author:   Ben

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us