473,624 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# - Windows Application - save a datatable to a new table

pod
298 Contributor
Hello
Everyday I run a complex query from the corporate database (Oracle), I then set a datatable's datasource with this recordset.

What I want is to be able to save this daily datatable/recordset in a new table in my database(MS Access) without having to know the table's schema. Is this possible?

Thanks,


P :oD
Nov 26 '07 #1
2 2215
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
Expand|Select|Wrap|Line Numbers
  1. Insert into newTable
  2. select * from baseTable
I think thats how the code goes.

However the order of the values expected will be according to the schema, and obviously an int cannot be written over by a varchar.

Do you want to create a new table and then insert the values into it?
Nov 26 '07 #2
pod
298 Contributor
Expand|Select|Wrap|Line Numbers
  1. Insert into newTable
  2. select * from baseTable
I think thats how the code goes.

However the order of the values expected will be according to the schema, and obviously an int cannot be written over by a varchar.

Do you want to create a new table and then insert the values into it?
That is exactly what I want to do. I thought that there could be a single command like ".CreateTableFr omDatatable"

Correct me if I'm wrong, but I think this SELECT/INTO is OK only when working from the same database. What I have is a datatable created from an Oracle database query ... and I want to create a new table in my MS Access Database.

I can do it the long way, get the schema, create the table, insert data row by row... I was hoping that this great .NET FRAMEWORK would have had something already built-in... and that is what I am searching... I am not the only one, I'm sure
Nov 27 '07 #3

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

Similar topics

2
1548
by: Garry Freemyer | last post by:
I wrote a screensaver, via Visual Studio 2003 in C# and I decided a wiser choice for me was to use an xml file to save my configs. Btw: I wonder if this is why every bit of documentation I've found for saving configuration info in an xml file speak of only doing this for web programming in fact, I get the impression that they have been slipped a mickey that made them forget that there are programs out there that are not web based, but I...
10
2125
by: Saso Zagoranski | last post by:
hi, this is not actually a C# problem but since this is the only newsgroup I follow I decided to post my question here (please tell me where to post this next time if you think this post shouldn't be here). I have two design questions: 1. what is the correct (or best) way to include database queries into the code if you plan on
8
1938
by: Inigo Jimenez | last post by:
I have an ASP .net web application installed in a Windows 2003 server. This web application has a webform that has a Datagrid. This Datagrid is filled with the data of a SQL table. I have a button that inserts a new row in the SQL table and then refresh the datagrid.
6
1449
by: Fred Morrison | last post by:
1. No Columns collection. 2. No ability to easily synchronize the underlying DataTable of a DataGrid when a row is deleted in the Grid. Once you sort (via the column headers) all bets are off as to whether the current row index of the data grid can be used directly as the Rows index of the DataTable. This is documented in the DataGrid Overview. 3. No way to access the default grid table style to make minor changes to just one column...
1
2668
by: John | last post by:
Hi, I have a datatable object in memory, the datasource is not from SQL server. I want to save this datatable into SQL server 2000, what is the best way to do it? The only way I know is to create table dynamically then loop thru datatable generate and execute an insert statement per row. Quite tedious. TIA
1
3791
by: seanmle | last post by:
I want to build a windows application that has a datagrid filled with data. When a person modifies information on a single cell, it updates the database without the user having to click on a save button. Any ideas on how I can accomplish this? Thanks, Sean
10
3748
by: AG | last post by:
I am trying to use a ReportViewer control in a VS 2005 web application project (not Website project). When I try to create a new report (local), I can't seem to find any method to create a datasource. I would like to use an existing class object. The examples I have found state that the class should be in the App_Code folder. However a WAP does not have an App_Code folder. Is there any way to specify a datasource for a local report in a...
2
3832
by: remya1000 | last post by:
i'm using VB.NET. and its a windows application. in my program i need to display a table in datagrid. so i created the table using DataTable and i'm calling that dataTable to dataGrid. and its working fine... but according to one of the field in that table i need to change the back color of that row. one of the field in that table called "Active", it will have value as True or False. so if Active =True then i need that corresponding row...
1
7260
pod
by: pod | last post by:
Hello Has anyone ever save a datatable to a database new table? If so, could you help me out and show me some sample code? Thanks Perry
0
8236
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8173
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8679
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.