Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Scalar query result in datagridview
 

Scalar query result in datagridview

Dear  all!

I have designed form and place there datagridview of table named USERS. I create cycle, reading the column contents and exequtes query (see bellow)


SELECT     COUNT(*) AS Results
FROM         vw_Reception
WHERE     (PH17 >= @PH17) AND (PH17 < @PH18) AND (WO15 = @WO07)

Which I add in product dataset (designe mode), UsersTableAdapter.

this query is correct, and displayes results, when I click "Prewiew Data", but I need display results of these code(see bellow)


 private void resultsToolStripButton_Click(object sender, EventArgs e)
        {
            for (quantity = 0; quantity < this.reportDataSet.Users.Rows.Count; quantity++)
            {
                name = this.usersDataGridView.Rows[quantity].Cells[1].Value.ToString();
                result = this.usersTableAdapter.localResults(startDate, endDate, name).ToString();
                //localresults is a name of scalar query
                quantity++;                                             
            }            
        }  

in the same datagridview(RESULTS column), where i load USERS table.
please, help.
Mirage_sk  Monday, October 05, 2009 2:15 PM
no ndeas? :(
Mirage_sk  Tuesday, October 06, 2009 12:16 PM

You can use google to search for other answers

Custom Search

More Threads

• Problem using C# app in windows2000
• getting row count
• Drilling down with DataGrid
• inserting excel data into sql server through vb.net
• hide column in datagrid
• SortArrow visual style problem
• how to make sure the cursor is in the cell on Datagridview control?
• Please help with a Problem When Adding new data row
• scrolling in a DataGridView
• Input String not in the correct format