Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > display scalar query results in a datagridview
 

display scalar query results in a datagridview

Dear All,

Code bellow is a datagridview scalar query an I need to display results in  datagridview cell

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


How can I do it?

Mirage_sk  Wednesday, October 07, 2009 1:26 PM
So, you are going to get ONE count value, like 42. And you want to display that one value in a DataGridView cell?

Which part of this don't you know how to do? To call the ExecuteScalar method or to get the resulting value into a DataGridView cell?
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Wednesday, October 07, 2009 6:14 PM
Thank  for answer :)
I execute scalar query and display results as label.text, but i need to display it into a DataGridView Cell
Mirage_sk  23 hours 0 minutes ago
This is how you put a value into a cell:

DataGridView1(2, 1).Value = myValue

Where (2,1) are the cell and row indexes.

Hope this helps.


www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  15 hours 3 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• How to get or read the last letter from a text box? - Vb.net or VS 2005
• using dataView
• DataAdapter.Update() dosen't work !
• DataGridView button click event
• Combobox Problem in DataGridView - calling all gurus
• Moving the focus to the next cell in a datagridview in visual basic 2008 when pressing enter key
• Dataview Value
• DataGridView Keypress problem
• DataGridView Horizontal Scroll change on Column Sort
• Html Control with data binding on HTML property