473,387 Members | 1,464 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,387 software developers and data experts.

Inserting datarow into Access table?

VMI
Assuming I have a datarow (or a datarow collection), would it possible to
create an Access table and dump the datarow(s) into that Access table? I
wouldn't even need to create the fields in the Access table since the
datarow contains the exact table schema. I'm currently taking each datarow
and creating an Insert statement that i then run against Access.
Nov 16 '05 #1
2 2478
Hi,

What if you add these rows to a DataTable, then configure an
OleDbDataAdapter with a proper connection and insert command, and then just
invoke Update on the pre-configured data adapter?
You can go even further and utilize the CommandBuilder class to generate the
insert command automatically based on the select command from the target
table.

Hope this helps.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"VMI" <vo******@yahoo.com> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
Assuming I have a datarow (or a datarow collection), would it possible to
create an Access table and dump the datarow(s) into that Access table? I
wouldn't even need to create the fields in the Access table since the
datarow contains the exact table schema. I'm currently taking each
datarow and creating an Insert statement that i then run against Access.


Nov 16 '05 #2
VMI
I'm not sure I completely understand .
What would the Insert command in the oleDbAdapter look like? Once I have my
DataTable with the all the rows, what would I need to do next?

Thanks.

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:Or****************@TK2MSFTNGP09.phx.gbl...
Hi,

What if you add these rows to a DataTable, then configure an
OleDbDataAdapter with a proper connection and insert command, and then
just invoke Update on the pre-configured data adapter?
You can go even further and utilize the CommandBuilder class to generate
the insert command automatically based on the select command from the
target table.

Hope this helps.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"VMI" <vo******@yahoo.com> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
Assuming I have a datarow (or a datarow collection), would it possible to
create an Access table and dump the datarow(s) into that Access table? I
wouldn't even need to create the fields in the Access table since the
datarow contains the exact table schema. I'm currently taking each
datarow and creating an Insert statement that i then run against Access.

Nov 16 '05 #3

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

Similar topics

0
by: sql_Michael_dotnet | last post by:
Can anyone help me figure out how to insert data into SQL Server when a table to hold the data does not yet exist. I am able to insert data into a existing table in the following fashion. But what...
1
by: Azel | last post by:
Hi, I am trying to learn ADO.net and I keep running into problems trying to insert data into my Access Database: data.mdb. here is my code: <code> // Database Variables
4
by: Deepankar | last post by:
Hi, I was trying to change an example for SQL Server to work with Access db to insert image data. I have everything working except getting the OleDbParameter type for the image column. The...
1
by: VMI | last post by:
Assuming I have a datarow (or a datarow collection), would it possible to create an Access table and dump the datarow(s) into that Access table? I wouldn't even need to create the fields in the...
2
by: sweetness | last post by:
I'm new to this and desperately need help, I'm trying to insert into an sql db and i have no idea what to do and why. i created an sqladapter, and an sqlconnection by dragging and dropping. this...
3
by: rcoco | last post by:
Hi, I want to share this problem. I have a datagrid that will help me Insert data into sql database. So I made a button On my form so that when I press the button a new row on datagrid should be...
6
by: Manikandan | last post by:
Hi, I need to insert the datetime with milliseconds value into a datarow. My code as below DataTable testDataTable=new DataTable(); testDataTable.Columns.Add("updatedDateTime",...
3
by: joel | last post by:
Hi guys, Im new to vb.net and i have this problem how do i insert another row into my datatable... (i guess it's like creating a for loop or something i really have no idea)... in this code i...
0
by: dalaimanoj | last post by:
Hi experts, I have a form in which there are 4 textboxes and few command buttons like New, View, Save, Delete. I want to insert the values entered in textboxes are to be stored in an Oracle...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.