473,406 Members | 2,769 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,406 software developers and data experts.

Running Insert/update SQL against ADO.NET dataset

So as you all know the great thing about ADO.NET is that I can take an
entire table from a database and dump it into an in memory datatable
using ADO.NET.

Well my question is that now that I have this temporary table, is it
possible to run SQL commands against it like it were an "actual"
table.

To give a simplistic example, lets say I have a table in my SQL Server
database called "Customers" that contains 2 columns (CustomerID,
CustomerName)

I dump that table into a ADO.NET object so now I have all of the rows
in that in memory datatable. Now I have this stored procedure that I
want to run against this in memory table. Would that be possible?

I know you can add a row by creating a datarow and doing it all
manually...but I much rather just run a stored proc.

Is this even possible??
Apr 2 '08 #1
7 3188
Matt <Kr****@gmail.comwrote in news:b5204b80-548e-4e53-a5ab-
35**********@m36g2000hse.googlegroups.com:
So as you all know the great thing about ADO.NET is that I can take an
entire table from a database and dump it into an in memory datatable
using ADO.NET.
Yes, but that doesn't make it a great thing. In fact in most cases, it's
a downright bad thing!
Well my question is that now that I have this temporary table, is it
possible to run SQL commands against it like it were an "actual"
table.
You can do basic commands through a dataview. But no, it's not an in-
memory database with full SQL support.

LINQ however should be able to provide with the features you need.
I dump that table into a ADO.NET object so now I have all of the rows
in that in memory datatable. Now I have this stored procedure that I
want to run against this in memory table. Would that be possible?
No, stored procedures are for databases.
I know you can add a row by creating a datarow and doing it all
manually...but I much rather just run a stored proc.

Is this even possible??
Why not run the query against a DB instead of an in memory version?

--
sp**********@rogers.com (Do not e-mail)
Apr 2 '08 #2
I agree with the original question-- if it is an in-memory database--
why can't we submit queries to it?

COM+ with Windows 2000 pre-release included a seperate 'in-memory'
database but this was postponed until the release of .NET.

I think that a simple- in memory database- would be a lot of fun;
especially if it automatically synchronized and logged.

I don't thnk that most server databases really scale as well with
additional memory-- as it should.

Hhaving a 2gb database on a server with 4gb of ram-- everything should
be instant.

I'm not sure that SQL Server really is loose enough with memory.

Google has some in-memory database structures, I believe.

honestly http://code.google.com

-Aaron

On Apr 2, 12:21*pm, Spam Catcher <spamhoney...@rogers.comwrote:
Matt <Kru...@gmail.comwrote in news:b5204b80-548e-4e53-a5ab-
358a2a798...@m36g2000hse.googlegroups.com:
So as you all know the great thing about ADO.NET is that I can take an
entire table from a database and dump it into an in memory datatable
using ADO.NET.

Yes, but that doesn't make it a great thing. In fact in most cases, it's
a downright bad thing!
Well my question is that now that I have this temporary table, is it
possible to run SQL commands against it like it were an "actual"
table.

You can do basic commands through a dataview. But no, it's not an in-
memory database with full SQL support.

LINQ however should be able to provide with the features you need.
I dump that table into a ADO.NET object so now I have all of the rows
in that in memory datatable. *Now I have this stored procedure that I
want to run against this in memory table. *Would that be possible?

No, stored procedures are for databases.
I know you can add a row by creating a datarow and doing it all
manually...but I much rather just run a stored proc.
Is this even possible??

Why not run the query against a DB instead of an in memory version?

--
spamhoney...@rogers.com (Do not e-mail)
Apr 2 '08 #3
Matt,

If you create only a table, then you need only to add an insert command to
the insertcommand part of a dataadapter and a transact SQL insert command,
than can be either a stored procedure or in line in the command code (If it
is a small project that is in my opinion advisable, is it a huge solution
then I would use a stored procedure).

It is just
A DataTable where new rows are inserted,
A SQLDataAdapter
A SQL transact insert string
A SQL connection
A SQLCommand that has set its properties with that
Adding the later to the adapter
Doing a SQLDataAdapter Update with the table

Cor

"Matt" <Kr****@gmail.comschreef in bericht
news:b5**********************************@m36g2000 hse.googlegroups.com...
So as you all know the great thing about ADO.NET is that I can take an
entire table from a database and dump it into an in memory datatable
using ADO.NET.

Well my question is that now that I have this temporary table, is it
possible to run SQL commands against it like it were an "actual"
table.

To give a simplistic example, lets say I have a table in my SQL Server
database called "Customers" that contains 2 columns (CustomerID,
CustomerName)

I dump that table into a ADO.NET object so now I have all of the rows
in that in memory datatable. Now I have this stored procedure that I
want to run against this in memory table. Would that be possible?

I know you can add a row by creating a datarow and doing it all
manually...but I much rather just run a stored proc.

Is this even possible??
Apr 3 '08 #4
Cor -

I'm not looking to update the original database table via the
dataadapter. I'm looking to update the in memory datatable with the
insert command. Will that still work?

Everyone -

Basically I have a folder full of stored procedures that I want to run
against an in memory database.
Apr 3 '08 #5
Matt,

You don't have an in-memory database and you can't run stored procedures
against datatables.

Kerry Moorman
"Matt" wrote:
Cor -

I'm not looking to update the original database table via the
dataadapter. I'm looking to update the in memory datatable with the
insert command. Will that still work?

Everyone -

Basically I have a folder full of stored procedures that I want to run
against an in memory database.
Apr 3 '08 #6
Well that is how ADO.net is presented to us. As an in-memory
database.
It seems to me like you should be able to write optimized Stored
Procedures to work against this IMDB.

In my opinion-- ADO.net can't even keep a connection _OPEN_.
Now _THAT_ is helpful.

-Aaron

On Apr 3, 7:43*am, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
Matt,

You don't have an in-memory database and you can't run stored procedures
against datatables.

Kerry Moorman

"Matt" wrote:
Cor -
I'm not looking to update the original database table via the
dataadapter. *I'm looking to update the in memory datatable with the
insert command. *Will that still work?
Everyone -
Basically I have a folder full of stored procedures that I want to run
against an in memory database.- Hide quoted text -

- Show quoted text -
Apr 4 '08 #7
Matt wrote:
Cor -

I'm not looking to update the original database table via the
dataadapter. I'm looking to update the in memory datatable with the
insert command. Will that still work?

Everyone -

Basically I have a folder full of stored procedures that I want to run
against an in memory database.
Written in what? Oracle stored procedures only work in Oracle; SQL Server stored
procedures only work in SQL Server. PL/SQL is not the same as T/SQL.

For ADO.Net, you write your "stored procedures" in - you guessed it - .Net.
Apr 5 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Sway | last post by:
I'm writing a web-based "Query analyser" tool for our company intranet. It allows a user to type any SQL statement in a form, and execute it over the Web. The SQL can be a query that returns...
1
by: Yog | last post by:
I have a datagrid binded to a dataset and once the user updates the grid my dataset is reflected. When i wanted to save the data to tables, however i needed to insert this data into another...
16
by: LP | last post by:
Hi, Every morning a .NET application downloads a file with cumulative data which needs to be appended to SQL Server table. This program needs to identify records that have not been previously...
2
by: kennethgrice | last post by:
Hi, I am new to ASP.net and visual studio.net. I have created a new ASP.NET Web Application and have started with a simple form. I have created a simple test database that will store a...
2
by: Rich | last post by:
Hello, I have an oleDBDataAdapter (da1) which gets data from an Access mdb and fills a dataset (ds1) with integer data from "tbl1" in Access. Data displays in textboxes on a form. The...
3
by: iKiLL | last post by:
Hi all I am having problems getting my SqlCeDataAdapter to Update the SQL Mobile Data base. i am using C# CF2. I have tried this a number of different ways. Starting with the command builder...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a...
13
by: Terry Olsen | last post by:
I'm using OleDb to connect with an Access Database. I have anywhere from 10 to over 100 records that I need to either INSERT if the PK doesn't exist or UPDATE if the PK does exist, all in a single...
5
by: =?ISO-8859-1?Q?Gear=F3id?= | last post by:
Hey, This may sound odd, but is there anyway to catch the current or just run query from inside a trigger? Kinda like how profiler displays the query just as you've run it, along with all the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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,...
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.