Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Like INSERT,DELETE AND UPDATE statements,is there any statement to read data from database? I am using visual studio 2008 and sql server 2008. I want to read an element from a row of a database. I have searched on net but the code there is of cs file. but i want code of aspx file. Thanks in advance.
Posted
Comments
Dylan Morley 19-Nov-10 9:45am    
SELECT!
Ed Guzman 21-Nov-10 15:00pm    
You amused me with the question :-).

What good would a database be if you couldn't read data from it?? It's a SELECT query.

There's millions upon millions of examples on this out there and more than a few different ways to do it.

ASPX is just a page from an ASP.NET application. A .cs file is a C# code file. There is no difference between doing this operation in an ASP.NET app and a normal Windows Forms app, either of which is written in C#.

Let me get you started wit ha simple Google query -> "C# get data from database"[^]
 
Share this answer
 
ummm...sqldatareader and sqldataadapter are two approaches, one connected and other is disconnected architecture. you can find examples for both around the web for ado.net, linq and other means of db-program interaction
 
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