This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C6C716.4EDB4A40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi!
(Read this with font courier new or equal)
I have a table adapter which fills a datatable with data from two sql =
tables: Properties, and PropCompanyInfo:
tbl1.PropertyID pk identity(0,1)
tbl1.PropertyName
tbl2.ID pk identity(0,1)
tbl2._PropertyID
tbl2.CompID
tbl2.Comment
Selected with the query SELECT tbl1.PropertyID, tbl1.PropertyName, =
tbl2.ID, tbl2._PropertyID, tbl2.CompID, tbl2.Comment from Properties=20
left outer join PropCompanyInfo on tbl1.PropertyID =3D tbl2.PropertyID =
and tbl2.CompID =3D @CID
The result is all rows from Properties, joined with PropCompanyInfo =
where found.
I have a datagrid where the user should add or edit comments (the rows =
amount is static).
Could look like:
PropertyID PropertyName ID _PropertyID CompID Comment
7 Birdland =20
12 Fireland =20
As you can see in this example there are no rows with comments for this =
company.
Now I want to update tbl2 with all rows that have a comment added. I get =
the message that ID don't allow null. I also have to set the _PropertyID =
to the same as PropertyID, and the CompID has to be set somehow.
Since I have a dataset with a datatable, I think this could be made =
without events for the grid and other code?
I'm not a full time developer, so I think there are some fundamental =
things I don't get here? HELP!
Regards Magnus
------=_NextPart_000_0006_01C6C716.4EDB4A40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.3790.2759" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3D"Courier New" size=3D1>Hi!<BR>(Read this with font =
courier new or=20
equal)<BR>I have a table adapter which fills a datatable with data from =
two sql=20
tables: Properties, and=20
PropCompanyInfo:<BR><BR>tbl1.PropertyID pk =
identity(0,1)<BR>tbl1.PropertyName<BR>tbl2.ID &nbs=
p; =20
pk=20
identity(0,1)<BR>tbl2._PropertyID<BR>tbl2.CompID<BR>tbl2.Comment<BR><BR>S=
elected=20
with the query SELECT tbl1.PropertyID, tbl1.PropertyName, tbl2.ID,=20
tbl2._PropertyID, tbl2.CompID, tbl2.Comment from Properties =
</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D1>left outer join PropCompanyInfo =
on=20
tbl1.PropertyID =3D tbl2.PropertyID and tbl2.CompID =3D =
@CID<BR></FONT><FONT=20
face=3D"Courier New" size=3D1>The result is all rows from Properties, =
joined with=20
PropCompanyInfo where found.</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D1><BR>I have a datagrid where the =
user should=20
add or edit comments (the rows amount is static).<BR>Could look=20
like:<BR>PropertyID PropertyName ID =20
_PropertyID CompID =20
Comment<BR>7 =
Birdland </FONT></DIV>
<DIV><FONT face=3D"Courier New"=20
size=3D1>12 =20
Fireland <BR></FONT><FONT =
face=3D"Courier New"=20
size=3D1></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D1>As you can see in this example =
there are no=20
rows with comments for this company.<BR>Now I want to update tbl2 with =
all rows=20
that have a comment added. I get the message that ID don't allow null. I =
also=20
have to set the _PropertyID to the same as PropertyID, and the CompID =
has to be=20
set somehow.</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D1>Since I have a dataset with a =
datatable, I=20
think this could be made without events for the grid and other=20
code?</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D1>I'm not a full time developer, =
so I think=20
there are some fundamental things I don't get here? HELP!</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D1>Regards =
Magnus</FONT></DIV></BODY></HTML>
------=_NextPart_000_0006_01C6C716.4EDB4A40--