Connecting Tech Pros Worldwide Forums | Help | Site Map

Gridview with more than 2 tables

=?Utf-8?B?ZWdzZGFy?=
Guest
 
Posts: n/a
#1: Oct 8 '08
Hello. I'd like to know how can use in a Gridview more than two tables and
when I hit the update button should display for the child table a
dropdownlist instead of a textbox?


How can i do this two things? Best regards and thanks in advance for the help.

Alexey Smirnov
Guest
 
Posts: n/a
#2: Oct 8 '08

re: Gridview with more than 2 tables


On Oct 8, 7:19*pm, egsdar <egs...@discussions.microsoft.comwrote:
Quote:
Hello. I'd like to know how can use in a Gridview more than two tables and
when I hit the update button should display for the child table a
dropdownlist instead of a textbox?
>
How can i do this two things? Best regards and thanks in advance for the help.
Hi. Check the following articles

http://msdn.microsoft.com/en-us/library/ms972948.aspx
http://msdn.microsoft.com/en-us/library/ms178294.aspx
=?Utf-8?B?ZWdzZGFy?=
Guest
 
Posts: n/a
#3: Oct 9 '08

re: Gridview with more than 2 tables


I'm really thankful. It works, but I'm really sorry but now i have this:

Table A:
ID Resource IDgroup
1 Callcenter 2

Table B:
IDgroup Description
1 Human Resources
2 Networking


And with your help, when I hit edit, it displays the content with the
dropdown list as it should be and I'm able to update it, but after that it
displays back the content of table A. Is there a way that in normal mode i
can display the grid like this:

Gridview:
ID Resource IDgroup
1 Callcenter Networking

Thanks again.


"Alexey Smirnov" wrote:
Quote:
On Oct 8, 7:19 pm, egsdar <egs...@discussions.microsoft.comwrote:
Quote:
Hello. I'd like to know how can use in a Gridview more than two tables and
when I hit the update button should display for the child table a
dropdownlist instead of a textbox?

How can i do this two things? Best regards and thanks in advance for the help.
>
Hi. Check the following articles
>
http://msdn.microsoft.com/en-us/library/ms972948.aspx
http://msdn.microsoft.com/en-us/library/ms178294.aspx
>
Alexey Smirnov
Guest
 
Posts: n/a
#4: Oct 9 '08

re: Gridview with more than 2 tables


On Oct 9, 2:05*am, egsdar <egs...@discussions.microsoft.comwrote:
Quote:
I'm really thankful. It works, but I'm really sorry but now i have this:
>
Table A:
ID * * Resource * *IDgroup
1 * * *Callcenter * 2
>
Table B:
IDgroup * Description
1 * * * * * *Human Resources
2 * * * * * *Networking
>
And with your help, when I hit edit, it displays the content with the
dropdown list as it should be and I'm able to update it, but after that it
displays back the content of table A. Is there a way that in normal mode i
can display the grid like this:
>
Gridview:
ID * * Resource * *IDgroup
1 * * *Callcenter * Networking
>
Thanks again.
>
"Alexey Smirnov" wrote:
Quote:
On Oct 8, 7:19 pm, egsdar <egs...@discussions.microsoft.comwrote:
Quote:
Hello. I'd like to know how can use in a Gridview more than two tables and
when I hit the update button should display for the child table a
dropdownlist instead of a textbox?
>
Quote:
Quote:
How can i do this two things? Best regards and thanks in advance for the help.
>
Quote:
Hi. Check the following articles
>
it's a matter of your request, if you said "IDgroup" it shows "2"
because this is the value from IDgroup field. To show Description
value from another table you need to join that table.

For example, look at the article I sent you. There is a request like

<asp:SqlDataSource ID="..." Runat="server"
SelectCommand="SELECT ...."
ConnectionString="<%$ ConnectionStrings:NWConnectionString %>">

You would need to change that SelectCommand as

SelectCommand="SELECT a.ID, a.Resource, a.IDGroup, b.DESCRIPTION
FROM tableA a, TABLEB b
WHERE a.IDGroup=b.IDGroup"

=?Utf-8?B?ZWdzZGFy?=
Guest
 
Posts: n/a
#5: Oct 10 '08

re: Gridview with more than 2 tables


I'm going throguh a learning process with ASP.net and I'm really thankful
with your support and patience. After all it works.

"Alexey Smirnov" wrote:
Quote:
On Oct 9, 2:05 am, egsdar <egs...@discussions.microsoft.comwrote:
Quote:
I'm really thankful. It works, but I'm really sorry but now i have this:

Table A:
ID Resource IDgroup
1 Callcenter 2

Table B:
IDgroup Description
1 Human Resources
2 Networking

And with your help, when I hit edit, it displays the content with the
dropdown list as it should be and I'm able to update it, but after that it
displays back the content of table A. Is there a way that in normal mode i
can display the grid like this:

Gridview:
ID Resource IDgroup
1 Callcenter Networking

Thanks again.

"Alexey Smirnov" wrote:
Quote:
On Oct 8, 7:19 pm, egsdar <egs...@discussions.microsoft.comwrote:
Hello. I'd like to know how can use in a Gridview more than two tables and
when I hit the update button should display for the child table a
dropdownlist instead of a textbox?
Quote:
How can i do this two things? Best regards and thanks in advance for the help.
Quote:
Hi. Check the following articles
>
it's a matter of your request, if you said "IDgroup" it shows "2"
because this is the value from IDgroup field. To show Description
value from another table you need to join that table.
>
For example, look at the article I sent you. There is a request like
>
<asp:SqlDataSource ID="..." Runat="server"
SelectCommand="SELECT ...."
ConnectionString="<%$ ConnectionStrings:NWConnectionString %>">
>
You would need to change that SelectCommand as
>
SelectCommand="SELECT a.ID, a.Resource, a.IDGroup, b.DESCRIPTION
FROM tableA a, TABLEB b
WHERE a.IDGroup=b.IDGroup"
>
>
Alexey Smirnov
Guest
 
Posts: n/a
#6: Oct 11 '08

re: Gridview with more than 2 tables


On Oct 10, 9:03*pm, egsdar <egs...@discussions.microsoft.comwrote:
Quote:
I'm going throguh a learning process with ASP.net and I'm really thankful
with your support and patience. After all it works.
>
"Alexey Smirnov" wrote:
Quote:
On Oct 9, 2:05 am, egsdar <egs...@discussions.microsoft.comwrote:
Quote:
I'm really thankful. It works, but I'm really sorry but now i have this:
>
Quote:
Quote:
Table A:
ID * * Resource * *IDgroup
1 * * *Callcenter * 2
>
Quote:
Quote:
Table B:
IDgroup * Description
1 * * * * * *Human Resources
2 * * * * * *Networking
>
Quote:
Quote:
And with your help, when I hit edit, it displays the content with the
dropdown list as it should be and I'm able to update it, but after that it
displays back the content of table A. Is there a way that in normal mode i
can display the grid like this:
>
Quote:
Quote:
Gridview:
ID * * Resource * *IDgroup
1 * * *Callcenter * Networking
>
Quote:
Quote:
Thanks again.
>
Quote:
Quote:
"Alexey Smirnov" wrote:
On Oct 8, 7:19 pm, egsdar <egs...@discussions.microsoft.comwrote:
Hello. I'd like to know how can use in a Gridview more than two tables and
when I hit the update button should display for the child table a
dropdownlist instead of a textbox?
>
Quote:
Quote:
How can i do this two things? Best regards and thanks in advance for the help.
>
Quote:
Quote:
Hi. Check the following articles
>>
Quote:
it's a matter of your request, if you said "IDgroup" it shows "2"
because this is the value from IDgroup field. To show Description
value from another table you need to join that table.
>
Quote:
For example, look at the article I sent you. There is a request like
>
Quote:
<asp:SqlDataSource ID="..." Runat="server"
SelectCommand="SELECT ...."
ConnectionString="<%$ ConnectionStrings:NWConnectionString %>">
>
Quote:
You would need to change that SelectCommand as
>
Quote:
SelectCommand="SELECT a.ID, a.Resource, a.IDGroup, b.DESCRIPTION
FROM tableA a, TABLEB b
WHERE a.IDGroup=b.IDGroup"
great :-)
Closed Thread