Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
if i pass the query like use database1

then result is displayed like 'Command(s) completed successfully.'

same query i want to execute from front end.its working fine,bt how to catch that result.
pls. help.
Posted
Comments
Jignesh Khant 6-Jun-13 6:00am    
You can apply breakpoint and see the result of your dataset. You will see the data.
Oshtri Deka 6-Jun-13 6:22am    
I think I understand what is troubling you, but that is one poorly written question.

You should get an overview of ADO.Net. Then you can work on similar functionality. Here are few good articles:

A Beginner's Tutorial for Understanding ADO.NET[^]
http://csharp-station.com/Tutorial/AdoDotNet[^]
http://www.sitepoint.com/introduction-ado-net/[^]
 
Share this answer
 
Hi,

you can use SqlDataAdapter to execute your query in front end.

C#
string con="<sql db="" connection="" string="">";
string query="select * from table1";
SqlDataAdapter da=new SqlDataAdapter(query,con); 
Dataset ds=new Dataset();
da.fill(ds);


//bind the dataset value into an gridview control.

gridview1.datasource=ds;
gridview1.databind();</sql>



I think this will help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900