Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 28-02-2009
Member
 
Join Date: Feb 2009
Posts: 96
little confused about data grid view

im using the studio.net app

here is the problem:
i need to create 2 forms
1st form is bound to an employee info table
2nd form is unbound and on the form i need it to bring up payroll info from a different table when the user changes the 1st forms selected person

i tried doing it with vb2005 coding and that doesnt work

if anyone can point me in the right direction on how i could make the 2nd form work in conjuction with the 1st form to display the employees payroll amounts that would be great.

thanx in advance.

Daren
Reply With Quote
  #2  
Old 02-03-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: little confused about data grid view

http://dotnetperls.com/Content/DataG...-Tutorial.aspx take a look at this tutorial which gives more information about your problem.
Reply With Quote
  #3  
Old 02-03-2009
Member
 
Join Date: Jan 2009
Posts: 38
Re: little confused about data grid view

If you want more than 1 table viewed in a datagridview all you need to do is create a dataTable that has the tables you want to view.

Then set the datasource of the datagridview to the new dataTable. Of course the tables need to be in the same database.

You can make a new dataTable by double clicking the "DatasetName.xsd" file in your solution explorer window.

Then drag a datatable over from the toolbox and set its configuration to an SQL statement that grabs the data from the tables you want to combine, using either the query builder or a typed out statement.

Just make sure you join the related fields correctly or you'll end up with many duplicate rows of data.

I find it easier to include all fields from the tables I want then exclude unwanted fields in the "columns.collection" option of the datagridview in the properties window.

Example of Joining 2 tables: DataTest = Table 1, tblLogin = Table 2

SELECT DataTest.Username, DataTest.Value1, DataTest.Cleared2, DataTest.Value2, DataTest.value3, DataTest.[Entry Date], DataTest.Total,
DataTest.GrandTotal, tblLogin.LoginID, tblLogin.UserName AS Expr1, tblLogin.[Password], tblLogin.PassPhrase, tblLogin.PassAnswer
FROM DataTest, tblLogin
WHERE DataTest.Username = tblLogin.Username


Hope this helps for allowing DataGridView to show more than 1 table.
Reply With Quote
  #4  
Old 02-03-2009
Member
 
Join Date: Jan 2009
Posts: 44
Re: little confused about data grid view

Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls

I hope this will help you!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "little confused about data grid view"
Thread Thread Starter Forum Replies Last Post
How to view pivot table external data source in Microsoft Excel 200 LuniA MS Office Support 2 23-02-2012 12:09 PM
Why there is no game icon in grid view on Steam? Vrishabh Video Games 5 06-07-2011 11:00 AM
Display Data In Data Grid View Aakarshan.d Software Development 5 02-02-2010 09:31 PM
How to view commulated total data use in Reliance net connect broadband+ avinashmunnu India BroadBand 1 21-07-2009 09:42 AM
Fetching data from a database and display it in a view - Ruby on Rails Sadashiva Software Development 3 03-02-2009 10:59 PM


All times are GMT +5.5. The time now is 08:38 PM.