Solved

C# SQL CLR Create Stored Procedure with DataTable

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

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.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.
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…

707 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