Results 1 to 4 of 4

Thread: little confused about data grid view

  1. #1
    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

  2. #2
    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.

  3. #3
    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.

  4. #4
    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!

Similar Threads

  1. Replies: 2
    Last Post: 23-02-2012, 12:09 PM
  2. Why there is no game icon in grid view on Steam?
    By Vrishabh in forum Video Games
    Replies: 5
    Last Post: 06-07-2011, 11:00 AM
  3. Display Data In Data Grid View
    By Aakarshan.d in forum Software Development
    Replies: 5
    Last Post: 02-02-2010, 09:31 PM
  4. Replies: 1
    Last Post: 21-07-2009, 09:42 AM
  5. Replies: 3
    Last Post: 03-02-2009, 10:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,382,880.02123 seconds with 16 queries