Solved

C# SQL CLR Create Stored Procedure with DataTable

Posted on 2014-10-31
2
472 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

730 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