I
insirawali
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 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.