Re: Can this be done using a Data adapter??
- From: "JTC^..^" <dave@xxxxxxxxxxxxxxxx>
- Date: Sun, 12 Oct 2008 11:48:04 -0700 (PDT)
On 12 Oct, 01:55, "I~N~S~I" <insiraw...@xxxxxxxxx> wrote:
On Oct 11, 1:04 pm, "JTC^..^" <d...@xxxxxxxxxxxxxxxx> wrote:
On 11 Oct, 03:11, insiraw...@xxxxxxxxx wrote:
Hi all,
I have this problem, i need to know is there a way i cn use the data
adapter's update method in this scenario.
i have 3 tables as below
create table table1{
id1 int identity(1,1)
Constraint pk_table1 Primary Key,
title varchar(20) not null,
}
create table table2{
id2 int identity(1,1)
Constraint pk_table1 Primary Key,
title varchar(20) not null,
}
create table table3{
id1 int not null
Constraint fk_table3_1 Foreign Key References table1(id1),
id2 int not null
Constraint fk_table3_2 Foreign Key References table2(id2),
value int default 0,
Constraint pk_table3 Primary Key (id1,id2),
}
In my application i have a Datagrid view, which has all the records of
table1 as the columns of the datagrid view and records of table2 as
the rows of the data grid. and i have table 3 to store the values i
enter in Datagrid view.
I was wondering can i use the data adapter to fetch data of table3
using Fill method and use da update method of data adapter to add
values to table3.
I have no leads on how to start, thats why my 1st have the concern
whether i can do it using the Data adapter.
The only method i cn think of is loop through each cell im my datagrid
view and manually run the insert or update SQL commands. But that will
make my application very slow. specially when there is abt 40 records
in table1 and 100 records in table2... :-(
Can anyone giv me any leads.....
Thank you,
Insira.
I suggest you need to let SQL process the data. Use the SQL Select
statement to pivot the data then select it as you need into a
datatable. The datatable passes only the modified/new/deleted rows to
the respective commands. Those respective SQL statements takes care of
only processing the changed data.
I hope that helps! If not please post more exact details about the
data you are working with.
Thanks for ur reply,
but i'm confused on how to use sql to pivot the data. can you give me
an example on how to do it. (my SQL knowledge is not that good)- Hide quoted text -
- Show quoted text -
Do you have more info about the solution and data you are working
with?
The SQL statements, will just process the changed data, where ever or
however that might be stored in the database.
.
- Follow-Ups:
- Re: Can this be done using a Data adapter??
- From: I~N~S~I
- Re: Can this be done using a Data adapter??
- References:
- Can this be done using a Data adapter??
- From: insirawali
- Re: Can this be done using a Data adapter??
- From: JTC^..^
- Re: Can this be done using a Data adapter??
- From: I~N~S~I
- Can this be done using a Data adapter??
- Prev by Date: Midi Close
- Next by Date: Re: Midi Close
- Previous by thread: Re: Can this be done using a Data adapter??
- Next by thread: Re: Can this be done using a Data adapter??
- Index(es):
Relevant Pages
|
Loading