Link to home
Start Free TrialLog in
Avatar of timberadmin
timberadminFlag for Canada

asked on

C# SQL CLR Create Stored Procedure with DataTable

Hi experts,

I've massaged a bunch of data in my C# application and formed a final typed datatable in a dataset. Now, I'd like to pass this datatable back to SQL as a SQL CLR Stored Procedure. This way, I am able to make some complicated calculations in C# and return the data back to SQL for retrieval from various applications.

I tried following the only promising article that I could find (http://msdn.microsoft.com/en-ca/library/ff878201.aspx) but I'm having trouble passing in my typed DataTable in to the DataSetUtilities.SendDataTable(DataTable dt) method. Doing a DataSetUtilities.SendDataTable((DataTable)_dsMain.dtMyTable) returns error "Cannot convert from  "_dsMain.dtMyTable" to "System.Data.DataTable".

Am i going down the right path with this article or do you experts have some other suggestions for accomplishing this?
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial