Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jadi
Starting Member
20 Posts |
Posted - 2009-01-30 : 09:50:09
|
Hi I am new to .netI have two tablesHEADERSand LINESI want to display the data(all rows) from that tables in one data grid. Also I want to add 3 columns in there! Can you guide me throught that. |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2009-01-30 : 10:00:16
|
Create an Stored proc or View to combine those two tables with additional columns and use that view/SP as a data source for your grid.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
jadi
Starting Member
20 Posts |
Posted - 2009-01-30 : 10:08:23
|
Nice suggestion but I have a SP which puts the data from a view into the two tables and now I want to retrive it in the grid. Please can you guide me?Thanks in Advance |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-01 : 02:28:09
|
can u post table structures of header and linesif they have same no of columns use union r if it is having common col using joins |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-01 : 02:30:14
|
try like this once after getting the data from view to tables select h.col1,h.col2,....(cols of header),l.col1,l.col2 ..... (cols from lines) fromheader h inner joinlines l on h.col1 = l.col1if same columns (datatype should also match)select col1,col2,....from header union select col1,col2,....from lineswrite this code in a stored procedure then call that sp in ur front end (.net) u can have ur resultset |
|
|
|
|
|