How can i put qurey adapter to datagrid c#

i have a ScalarQuery How can I put it into  datadrid
dataset1.JPG
teeraAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
hamidovtConnect With a Mentor Commented:
Hi,

In example I have sent http://msdn2.microsoft.com/en-us/library/aa581776.aspx 
Insert is a scalar query. They execute it as:
// Add a new product
productsAdapter.Insert("New Product", 1, 1, "12 tins per carton",  14.95m, 15, 0, 10, false);

In the sample it is actually it returning id of the inserted record. So you could do something like :
int myId = productsAdapter.Insert("...
And afterwads set it to the label or whatever control you want.

If this solves your problem, could you please accept the solution, because otherwise the question will remain open.
0
 
hamidovtCommented:
Scalar query will return 1 result(even not a row), what is your idea of putting it into the datadrid???
0
 
hamidovtCommented:
Very common is to use scalar query for insert; it would return an id of the inserted row... But anywat there is no point of assiging its result to the grid. If you are searching for a good starting point, check this tutorial:  http://msdn2.microsoft.com/en-us/library/aa581776.aspx
0
 
teeraAuthor Commented:
I want to add a bottom then it show result of sql state ment I think i need datagrid but it seem I do not need data grid
0
All Courses

From novice to tech pro — start learning today.