Solved

C# SQL CLR Create Stored Procedure with DataTable

Posted on 2014-10-31
2
436 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

747 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

11 Experts available now in Live!

Get 1:1 Help Now