I am trying to create a child to parent form with databinding is this
possible?

I have 2 tables one "Users" and another "UserStatus"

The "Users" table consists of :
int UserID
string Username
string Password
int UserStatusID

And the "UserStatus" table consists of :
int UserStatusID
string Description

The form I am trying to create consists of :
Label UserID
Textbox Username
Textbox Password
ComboBox Description

I am new to .NET and any help will appreciated.

Thanks

Adam Stirk

Re: Child to Parent Databindig by Miha

Miha
Wed Nov 26 06:31:47 CST 2003

Hi Adam,

One way would be to use JOIN statament when loading records.
The other would be to add "calculated" columns to parent datatable and write
the children data into.
There are other ways though, depending on the situation.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Adam Stirk" <a-d_a-m_s@b-r_a-n_t-a_n-t_a-n_o.c-o.u_k> wrote in message
news:eMm82hBtDHA.3532@TK2MSFTNGP11.phx.gbl...
> I am trying to create a child to parent form with databinding is this
> possible?
>
> I have 2 tables one "Users" and another "UserStatus"
>
> The "Users" table consists of :
> int UserID
> string Username
> string Password
> int UserStatusID
>
> And the "UserStatus" table consists of :
> int UserStatusID
> string Description
>
> The form I am trying to create consists of :
> Label UserID
> Textbox Username
> Textbox Password
> ComboBox Description
>
> I am new to .NET and any help will appreciated.
>
> Thanks
>
> Adam Stirk
>
>



Re: Child to Parent Databindig by Adam

Adam
Wed Nov 26 07:16:57 CST 2003

Do you have an example?


"Miha Markic" <miha at rthand com> wrote in message
news:up0%23ElBtDHA.684@TK2MSFTNGP09.phx.gbl...
> Hi Adam,
>
> One way would be to use JOIN statament when loading records.
> The other would be to add "calculated" columns to parent datatable and
write
> the children data into.
> There are other ways though, depending on the situation.
>
> --
> Miha Markic - RightHand .NET consulting & software development
> miha at rthand com
>
> "Adam Stirk" <a-d_a-m_s@b-r_a-n_t-a_n-t_a-n_o.c-o.u_k> wrote in message
> news:eMm82hBtDHA.3532@TK2MSFTNGP11.phx.gbl...
> > I am trying to create a child to parent form with databinding is this
> > possible?
> >
> > I have 2 tables one "Users" and another "UserStatus"
> >
> > The "Users" table consists of :
> > int UserID
> > string Username
> > string Password
> > int UserStatusID
> >
> > And the "UserStatus" table consists of :
> > int UserStatusID
> > string Description
> >
> > The form I am trying to create consists of :
> > Label UserID
> > Textbox Username
> > Textbox Password
> > ComboBox Description
> >
> > I am new to .NET and any help will appreciated.
> >
> > Thanks
> >
> > Adam Stirk
> >
> >
>
>



Re: Child to Parent Databindig by Miha

Miha
Wed Nov 26 10:04:42 CST 2003

> Do you have an example?

Of which one?

The firt would be:
SELECT Users.*, UserStatus.Description FROM Users INNER JOIN UserStatus ON
Users.UserStatusId = UserStatus.UserStatusId

The second would be:

tblUsers.Columns.Add("Description", typeof(string))
foreach (DataRow row in tblUsers.Row)
{
DataRow childRow = tblUserStatus.Rows.Find(row["UserStatusId"]);
if (childRow != null)
row["Description"] = childRow["Description"];
}

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

>
> "Miha Markic" <miha at rthand com> wrote in message
> news:up0%23ElBtDHA.684@TK2MSFTNGP09.phx.gbl...
> > Hi Adam,
> >
> > One way would be to use JOIN statament when loading records.
> > The other would be to add "calculated" columns to parent datatable and
> write
> > the children data into.
> > There are other ways though, depending on the situation.



Re: Child to Parent Databindig by Adam

Adam
Fri Nov 28 09:58:11 CST 2003

So in a sense i have got to create my own databinding to get the results i
want.

If this is the case why did microsoft include databinding with winfoms???

Adam Stirk

"Miha Markic" <miha at rthand com> wrote in message
news:%23n6uDcDtDHA.424@TK2MSFTNGP11.phx.gbl...
> > Do you have an example?
>
> Of which one?
>
> The firt would be:
> SELECT Users.*, UserStatus.Description FROM Users INNER JOIN UserStatus ON
> Users.UserStatusId = UserStatus.UserStatusId
>
> The second would be:
>
> tblUsers.Columns.Add("Description", typeof(string))
> foreach (DataRow row in tblUsers.Row)
> {
> DataRow childRow = tblUserStatus.Rows.Find(row["UserStatusId"]);
> if (childRow != null)
> row["Description"] = childRow["Description"];
> }
>
> --
> Miha Markic - RightHand .NET consulting & development
> miha at rthand com
>
> >
> > "Miha Markic" <miha at rthand com> wrote in message
> > news:up0%23ElBtDHA.684@TK2MSFTNGP09.phx.gbl...
> > > Hi Adam,
> > >
> > > One way would be to use JOIN statament when loading records.
> > > The other would be to add "calculated" columns to parent datatable and
> > write
> > > the children data into.
> > > There are other ways though, depending on the situation.
>
>