Solved

C# SQL CLR Create Stored Procedure with DataTable

Posted on 2014-10-31
2
443 Views
Last Modified: 2014-11-05
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?
0
Comment
Question by:timberadmin
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 40417136
0
 
LVL 11

Assisted Solution

by:louisfr
louisfr earned 250 total points
ID: 40418889
It looks like _dsMain.dtMyTable is not a DataTable. What is its type?
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now