Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to use gridview

Reply
Thread Tools

How to use gridview

 
 
enak
Guest
Posts: n/a
 
      06-26-2006
I am new to ASP.NET 2.0 and am trying to use the gridview in an application.
I am used to using the datagrid and being able to bind it to a datareader
programmatically.

Is there a way to do that with the gridview? Here is what I have tried but
it is not visible:

sSQL =

"Select c.ClientName, a.lName + ', ' + a.fName + ' ' + a.middleInitial AS
ApplicantName," & _

"a.OrderedBy, a.DateOrdered " & _

"from tblApplicant AS a JOIN tblClient AS c ON a.ClientID = c.ClientID " & _

"Where DatePosted Is null"
dr = cDb.getDataReader(sSQL)


Me.gridNewRequests.DataSource = dr

Me.gridNewRequests.DataBind()

Me.gridNewRequests.Visible = True
cDb.closeConnection()

As you can see I am not using an SQLDataSource. Do you have to use it or can
I do it the way I am?

Please help me with this.

Thanks,

enak

 
Reply With Quote
 
 
 
 
Raven
Guest
Posts: n/a
 
      06-30-2006
yes, you can programmatically bind a GridView using the DataSource
property

<a
href="http://authors.aspalliance.com/aspxtreme/webforms/controls/addinggridviewcontrolstowebformspage.aspx">Adding
GridView Controls to a Web Forms Page</a>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
If I use the WAP add-on, can I not use GridView paging and sorting? Chris S ASP .Net 0 12-13-2006 10:03 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
GridView in a GridView Nalaka ASP .Net 6 12-05-2005 05:48 PM
Gridview with combobox whose data is dependent on field in gridview wallermj@hotmail.com ASP .Net 3 11-21-2005 05:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57