Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to pass an object to stored procedure? Expand / Collapse
Author
Message
Posted Tuesday, September 23, 2008 6:01 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 75, Visits: 271
Hi,

From asp.net c# application I am passing the user identity parameter
to a stored procedure for inserting. This user identity, which asp.net see as an object.
But I have no idea what SQL Server 2005 sees it as. Because if I put the parameter
as string, it failed.

But I have never heard of passing an object as a parameter to stored procedure.
if it is possible, and if so, how?

any input would be appreciated.
Post #574242
Posted Tuesday, September 23, 2008 6:18 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 24, 2013 4:42 AM
Points: 460, Visits: 2,523
I would suggest that you serialize the object to an XML string pass it to the stored procedure. From within your stored procedure you can extract the information from the XML parameter.

.
Post #574249
Posted Tuesday, September 23, 2008 5:11 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 75, Visits: 271
Thanks Jacob for responding. I found out that I could pass it
as string to stored procedure and leave it as windows identity type
in asp.net, then it works.

thanks. michelle.
Post #574830
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse