TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
meenakshi_krishnamurthy
NA
11
0
Can Datareader be used instead of Data Adapter to populate the Datagrid
Dec 8 2003 9:34 AM
In Windows Forms application using vb.net / access - can datareader be used to populate the datagrid? The datagrid in my form is just for display purposes. Modifications to the data will be handled by double clicking the grid which would take to another form which handles insert /update / delete. I tried to populate the datagrid with a datareader: Dim sql As String = "SELECT * FROM Pcardlog where RDM='R'" Cmd.Connection = Conn Cmd.CommandText = sql Conn.Open() DataGrid1.DataSource = Cmd.ExecuteReader I get the following error: An unhandled exception of type 'System.Exception' occurred in system.windows.forms.dll Additional information: Complex DataBinding accepts as a data source either an IList or an IListSource Could someone throw some light on how to get this to work?
Reply
Answers (
10
)
Datagrid wont display data when sql contains where clause
How to get datagrid cell value for the selected row?