I am using VS 2003 and trying to build a standalone application. I have
been writing all my asp.net work using DW and am just now trying to build a
application that will read some of the tables I had written out from my web
apps.
I can get my DataReader to read my data fine. But I wanted to use a
DataGrid, but it is apparently completely different????
I can do:
DataGrid1.DataS ource = dbReader
DataGrid1.DataB ind()
I get an error saying something about: "Complex DataBinding accepts as a
data source either an IList or an IListSource".
There also doesn't seem to be a DataBind() method to this DataGrid?
Why doesn't it work?
Can I not make a standalone program using the same techniques as I do in my
Web pages (asp.net)?
Thanks,
Tom 3 3344
tshad wrote: I am using VS 2003 and trying to build a standalone application. I have been writing all my asp.net work using DW and am just now trying to build a application that will read some of the tables I had written out from my web apps.
I can get my DataReader to read my data fine. But I wanted to use a DataGrid, but it is apparently completely different????
I can do:
DataGrid1.DataS ource = dbReader DataGrid1.DataB ind()
I get an error saying something about: "Complex DataBinding accepts as a data source either an IList or an IListSource".
There also doesn't seem to be a DataBind() method to this DataGrid?
Why doesn't it work?
Can I not make a standalone program using the same techniques as I do in my Web pages (asp.net)?
Thanks,
Tom
You can not bind a datareader to a datasource. You will need to either
load it into a datatable by looping through the datareader or use a
dataadapter to do what you want.
chris
"I Don't Like Spam" <no@spam.com> wrote in message
news:OH******** ******@TK2MSFTN GP14.phx.gbl... tshad wrote: I am using VS 2003 and trying to build a standalone application. I have been writing all my asp.net work using DW and am just now trying to build a application that will read some of the tables I had written out from my web apps.
I can get my DataReader to read my data fine. But I wanted to use a DataGrid, but it is apparently completely different????
I can do:
DataGrid1.DataS ource = dbReader DataGrid1.DataB ind()
I get an error saying something about: "Complex DataBinding accepts as a data source either an IList or an IListSource".
There also doesn't seem to be a DataBind() method to this DataGrid?
Why doesn't it work?
Can I not make a standalone program using the same techniques as I do in my Web pages (asp.net)?
Thanks,
Tom
You can not bind a datareader to a datasource. You will need to either load it into a datatable by looping through the datareader or use a dataadapter to do what you want.
Is that something that something that you can only do in a web page? I
databind datareaders to a datagrid all the time?
Tom
chris
Thsad,
Although that the grid have in net 1.x for ASPNET and Windowforms the same
name (DataGrid), do they act completely different (in Net 2.0 the new Grids
have different names, it is probably not for nothing that this confusing
thing is now done well).
However there are some things the same. The ASPNET datagrid accepts a
DataReader, a Datatable and a DataSet. A windowform DataGrid (in theory more
however in fact) only the last two.
To see a lot of samples about the datagrid can you look on our (non
commercial) website. http://www.vb-tips.com/default.aspx
I hope this helps,
Cor
"tshad" <ts**********@f tsolutions.com> schreef in bericht
news:uZ******** ******@TK2MSFTN GP15.phx.gbl... I am using VS 2003 and trying to build a standalone application. I have been writing all my asp.net work using DW and am just now trying to build a application that will read some of the tables I had written out from my web apps.
I can get my DataReader to read my data fine. But I wanted to use a DataGrid, but it is apparently completely different????
I can do:
DataGrid1.DataS ource = dbReader DataGrid1.DataB ind()
I get an error saying something about: "Complex DataBinding accepts as a data source either an IList or an IListSource".
There also doesn't seem to be a DataBind() method to this DataGrid?
Why doesn't it work?
Can I not make a standalone program using the same techniques as I do in my Web pages (asp.net)?
Thanks,
Tom
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Al |
last post by:
in order to implement sorting, paging in a datagrid, can I
have the datasource of the datagrid a datareader or it
must be a dataset then I create a dataview and make it a
datasource of the datagrid?
The reason I am asking this question is because I already
created a datagrid and made its datasource a datareader,
yet, could not implement sorting or paging. Any idea of
how to approach it .
thanks
|
by: Jason Huang |
last post by:
Hi,
Is it possible to bind DataReader to a DataGrid in C# windows form? And
how?
And can we update data in a DataSet by using the DataReader?
Thanks for help.
Jason
|
by: Wayne Wengert |
last post by:
I am trying to learn to use VS NET and codebehind for asp.net apps and I've
run into a problem trying to use a datareader.
I created a new webform and inserted and configured a sqlconnection and I
inserted a sqlcommand object with the query string. The form has a datagrid
object which I want to bind to the returned data. I want to add a datareader
to get the actual data but I cannot find a datareader in the toolbox? I
looked under the...
|
by: BC |
last post by:
Hi,
Been searching the newgroups but haven't found an
answer.
I'm used to binding disconnected ADO recordsets
to Datagrid controls and tweaking the Datagrid to
suit my needs (columnheader, columnwidth, etc.)
Now I'm using vb.net, and I'm tryint to do the same
|
by: Thomas Scheiderich |
last post by:
I have 2 dropdowns that are exactly the same and I don't want to re-read
for each.
Is there a way to do something like below where I read the data, bind to
depCity1 and then bind to destCity2. I find that the second one always
is blank. I assume this is because the DataReader is read-forward only.
********************************************************
connect.open()
cmdSelect = New OleDbCommand("exec populateCities 'North...
| |
by: Jack Black |
last post by:
Hi, all! I have a populated Reader that I'm binding to a data grid,
and I'm trying to figure out how I can edit cells BEFORE binding the
reader to the DataGrid. Of the few pieces of sample code I've seen a
DataSet is required, and I really don't want to dump a lot of code
into something that may not need it: a quick bind to a reader dumps
data perfectly with zero hassle! ;-)
Obviously the Reader is (duh) read only, so I was wondering...
|
by: Shapper |
last post by:
Hello,
I have created a datareader function in a asp.net/vb web site.
The datareader returns only one record with 2 fields:
and
In the same aspx.vb I want to use this values as follows:
myImage.ImageURL =
myImage.Text =
|
by: hazz |
last post by:
The data access layer below returns, well, a mess as you can see on the last
line of this posting. What is the best way to return customer objects via a
datareader from the data layer into my view and bind them to a datagrid
using BindingList. I am in need of an epiphany here. Thank you. -Greg
******************BIND ARRAY OF CUSTOMER OBJECTS TO DATAGRID
************************
private Customer c;
c =...
|
by: dotComPaJi |
last post by:
I have recently joined a company and while looking at the source code I did
find the following:
They were accessing data from database using dataReader and after that
passing it to List Class.
then accessing that data ( i,.e in List Box, dataGrid etc)
I was thinking that there is no need to pass it to List Class. Any
suggestions would be appreciated.
Also they were doing the same with dataSet..passing it to datatable.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |