codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Displaying In DataGrid  eshwar_gp at 06:06 on Friday, January 21, 2005
 

Hi:
How can i display fields from two or more tables to one grid?

Please let me know.


Regards,
eshwar_gp

  Re: Displaying In DataGrid  Granby at 16:50 on Wednesday, January 26, 2005
 

Use a template column in your datagrid. Call a function within that template. That function then queries the second table in your database and generates appropriate output. Like so:

<asp:TemplateColumn HeaderText="Information">
<ItemTemplate>
<%# GridOutput(Container.DataItem("Idx")) %>
</ItemTemplate>
</asp:TemplateColumn>

Function GridOutput(Idx as integer)
'some code to query table
'some html string built as needed
'return the string
end function


In the case above, the custom function is GridOutput. Write this function and query data as much as you want. Special important note: You will need to open a second connection, as the first is busy filling the datagrid.

Good luck.









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007