473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Insert object variable into ADO.NET dataset

1
First off, I basically know nothing about C# and .Net
In SSIS I select from Oracle into an Object variable using execute SQL task with ADO.Net connection.

I now need to put the results into SQL Server but can't do it per column as my query result has 60 columns. (My test worked but that was only for 5 columns).

The code I have thus far is:

Expand|Select|Wrap|Line Numbers
  1.             DataSet set = new DataSet();
  2.             SqlConnection conn = new SqlConnection("Data Source=localhost;Initial Catalog=PRU_MIS_ODS;Integrated Security=SSPI;");
  3.  
  4.             SqlDataAdapter adapt = new SqlDataAdapter("SELECT * FROM ADO_Test WHERE 1=0", conn);
  5.             SqlCommandBuilder cmd = new SqlCommandBuilder(adapt);
  6.             adapt.Fill(set, Dts.Variables["AdminResults"].Value.ToString());
  7.             adapt.Update(set, "Admin");
  8.  
  9.  
What do I need to add/amend in the code for this to work. I know a sp would probably work better but given our go-live cycles and procedures, I don't have time for that route.

Thanx for the help.
Jun 4 '10 #1
0 940

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Joe Blow via DotNetMonster.com | last post by:
Hello, I have a design problem involving class instances as global variables. To give you my background, I've programmed lots in Java, and most of it has been large class structures. I'm...
0
by: Harmony407 | last post by:
Hello: I am currently creating a database in which a user can scan an image into MS Access. The images once scanned, will be held in a seperate table. Here is my problem. The scanner is not...
0
by: Reza Sadeghi | last post by:
Hi, I want to convert my custom object to DataSet and I am wondering which way would be more efficient, the way I am thinking is to Serialize the object to XML Document and then convert XML to...
4
by: nelsonchang | last post by:
Dear all, I wrote the VB code in a "button press event" as below in which is retrieve data from SQL server and insert the data into Excel. After that, I would call Excel "subtotal" API to build a...
2
by: netbari | last post by:
I created a web-service on my local web server. I call a method from my ASP.NET app to return a dataset from the pubs db in SQL Server 7.0. I receive this error message 'object variable not set....
6
by: Neo Geshel | last post by:
I am trying to deal with an image in code-behind. I consistently get the following error: Server Error in '/' Application. Object variable or With block variable not set. Description: An...
3
by: Richard Hollenbeck | last post by:
I've marked the line in this subroutine where I've been getting this error. It may be something stupid but I've been staring at this error trying to fix it for over an hour. I'm pretty sure the...
9
by: axs221 | last post by:
I am trying to move some of our large VBA Access front-end file into ActiveX DLL files. I created two DLL files so far, one was a module that contains code to integrate into the QuickBooks...
3
by: Newbie19 | last post by:
I'm trying to get a list of all subfolders in a folder on a share drive, but I keep on getting this error message: Object variable or With block variable not set. Description: An unhandled...
2
by: yeap | last post by:
Hi All, I can't insert java variable into ms access database. I'm using odbc connection to ms access. Below are my coding. try { ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.