473,466 Members | 1,334 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SqlDataSource Data, Can not get to it

LVP
Hi,

I have a sqldatasource01 configured properly and can databind it to a
CheckBoxList and see data with no problem.

How can I get the data programmatically from the sqldatasource01
I need to loop through it. and get the extra columns passed in the
sqldatasource01
I don't want to loop through the CheckBoxList because it does not have all
the extra columns.

Can I do this with one sqldatasource and not two.

help

thanks

LVP

Jan 3 '08 #1
2 1333
On 3 Jan, 19:47, "LVP" <lvp_agent...@hotmail.comwrote:
Hi,

I have a sqldatasource01 configured properly and can databind it to a
CheckBoxList and see data with no problem.

How can I get the data programmatically from the sqldatasource01
I need to loop through it. and get the extra columns passed in the
sqldatasource01
I don't want to loop through the CheckBoxList because it does not have all
the extra columns.

Can I do this with one sqldatasource and not two.

help

thanks

LVP
Hi

The SqlDataSource component is really for binding directly to web
server controls at design time to save coding. I think you'll find
that the internal data structures of those components aren't really
accessible in code.

If you require programmatic access to SQL data tables (and you don't
want to write reams of code using the traditional components in the
System.Data.SqlClient name space) then try adding a DataSet to the
project. A wizard will take you through the process of setting up a
TableAdapter (a new version of the old SqlDataAdapter) and DataTable
defined in an XSD file (which by default will go in the App_Code
folder).

New namespaces will be added to your project containing objects for
the TableAdapter and DataTable which can be created and used as
required (DataViews then can be created and used in the normal
manner). Whatever columns you require can be exposed in the Select
statement (the wizard can bring up QueryBuilder if you wish to
construct it visually). The DataTable can also be used as the
datasource for the CheckBoxList if you like so that only one
datasource is used, but the binding process will require some
programmatic intervention. Try it and see.

Jan 3 '08 #2
LVP
Phil,

I will follow your recommendations and see where I get stuck next.

I appreciate you taking the time to explain this.

much thanks,

LVP
"Phil H" <go****@philphall.me.ukwrote in message
news:bd**********************************@i12g2000 prf.googlegroups.com...
On 3 Jan, 19:47, "LVP" <lvp_agent...@hotmail.comwrote:
>Hi,

I have a sqldatasource01 configured properly and can databind it to a
CheckBoxList and see data with no problem.

How can I get the data programmatically from the sqldatasource01
I need to loop through it. and get the extra columns passed in the
sqldatasource01
I don't want to loop through the CheckBoxList because it does not have
all
the extra columns.

Can I do this with one sqldatasource and not two.

help

thanks

LVP

Hi

The SqlDataSource component is really for binding directly to web
server controls at design time to save coding. I think you'll find
that the internal data structures of those components aren't really
accessible in code.

If you require programmatic access to SQL data tables (and you don't
want to write reams of code using the traditional components in the
System.Data.SqlClient name space) then try adding a DataSet to the
project. A wizard will take you through the process of setting up a
TableAdapter (a new version of the old SqlDataAdapter) and DataTable
defined in an XSD file (which by default will go in the App_Code
folder).

New namespaces will be added to your project containing objects for
the TableAdapter and DataTable which can be created and used as
required (DataViews then can be created and used in the normal
manner). Whatever columns you require can be exposed in the Select
statement (the wizard can bring up QueryBuilder if you wish to
construct it visually). The DataTable can also be used as the
datasource for the CheckBoxList if you like so that only one
datasource is used, but the binding process will require some
programmatic intervention. Try it and see.

Jan 4 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a...
3
by: zapov | last post by:
Hi! Did anyone successfully managed to use some custom ADO.NET provider with SqlDataSource? I'd like to connect to some other database than MSSQL (like MySQL, Firebird or PostgreSQL) but I'm...
3
by: adam222 | last post by:
hello, i have a web-form with a GridView control, i wanted to update & delete, using the AutoGenerateEditButton. when i used it with sqlDataSource (executing SP in the DB) it works like a...
1
by: Mike P | last post by:
When you use a SqlDataSource to hook up data to a GridView it seems to be to be very inflexible. For example, I want to create my own Delete button with my own code and I also want to create a...
5
by: msch-prv | last post by:
Hi, I am trying to tie a SQLDataSource control to MySQL without success. The connection string works ok with an ObjectDataSource. (Native asp.net 2.0 MySQL dll loaded in /bin) For some reason,...
6
by: djc | last post by:
I had previously (in asp.net 1.1 and asp.net web matrix) just done this to populate a listbox with data from a database: ------------ this was from the page load event ---------------- 'fill...
6
by: Ken Fine | last post by:
I'm using SQLDataSource, which generates some kind of dataset, and then I attach that datasource to various data display controls such as DataList and repeater which loop through to the end of the...
1
by: Corey B | last post by:
I have a page with a DetailsView control and a SQLDataSource control. The SQLDataSource control is connected to an Access database. Everything works fine. Now I want to change the back end...
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
4
by: mohaaron | last post by:
This seems like it should be simple to do but for some reason I have been unable to make it work. I would like to databind a SqlDataSource to a GridView during the click event of a button. This...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
1
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...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.