Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 10th, 2010, 02:05 PM
Registered User
 
Join Date: Apr 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting query to GridView

Hi,

I'd like to set a query to a GridView control in order this GridView display the query result.
I do the following but I can not see the gridview,
What should I do, please advise.
Thanks,

protected void Page_Load(object sender, EventArgs e)
{
string oradb = "Data Source=LOCAL_XE;User Id=tzdl_user;Password=rans;";
OracleConnection conn = new OracleConnection(oradb); // C#
conn.Open();

OracleParameter parm = new OracleParameter();
parm.OracleDbType = OracleDbType.Decimal;
parm.Value = 777;

OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.Parameters.Add(parm);

cmd.CommandText = "select * from competence_test where id_num = :1";

cmd.CommandType = CommandType.Text;

OracleDataReader OraRecReader = cmd.ExecuteReader();

CompetenceTestGridView1.DataSource = OraRecReader;

conn.Dispose();
}
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting the gridview width svibuk ASP.NET 2.0 Professional 4 January 16th, 2009 03:39 AM
Setting Query Focus. eusanpe Access VBA 4 June 4th, 2008 10:20 AM
checkbox in gridview and setting "checked" Snuffles ASP.NET 2.0 Basics 2 April 7th, 2007 05:15 AM
Setting Gridview Dynamically copelanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 February 21st, 2007 01:28 PM
Setting GridView data to string hawkfb63 ASP.NET 2.0 Basics 1 January 31st, 2006 02:00 PM



All times are GMT -4. The time now is 08:26 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.