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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
hamidovtCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.