473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Getting Other Data from SQLDataSource ?

I have a GRIDVIEW I have bound to an OBJECTDATASOURCE that has the
select pointing to a class method that uses ADO to grab a dataset from
SQL Server Stored Procedure.

One of the columns that comes back I am not interested for the Grid,
But I would like the first ROW's value for a label.

I could do another IO to go get this, but Is there any way I can
extract this data from the DATASOURCE directly in the Codebehind?

Thanks for any help or information.

Aug 10 '07 #1
1 1644
Why are you using ObjectDataSource if the database is Sql Server?
SqlDataSource provides property DataSourceMode that can be used for getting
a DataTable object from the datasource.

Look here for details:

How to get DataTable out of SqlDataSource
http://msmvps.com/blogs/egoldin/arch...atasource.aspx

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"jobs" <jo**@webdos.comwrote in message
news:11**********************@i38g2000prf.googlegr oups.com...
I have a GRIDVIEW I have bound to an OBJECTDATASOURCE that has the
select pointing to a class method that uses ADO to grab a dataset from
SQL Server Stored Procedure.

One of the columns that comes back I am not interested for the Grid,
But I would like the first ROW's value for a label.

I could do another IO to go get this, but Is there any way I can
extract this data from the DATASOURCE directly in the Codebehind?

Thanks for any help or information.

Aug 10 '07 #2

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

Similar topics

9
by: Timm | last post by:
I have an ASP.NET 2.0 page with two DropDownLists. I am using declarative data binding wherever possible and trying to minimize the use of code. The list of values in DropDownList DDL2 should be...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
0
by: abillmeier | last post by:
I am just getting started messing with ASP 2.0, and am working on creating a quick data entry web hooked to a SQL database. I am using stored procedures to get and push data. I am having a...
6
by: Dabbler | last post by:
I have a GridView with a couple of TemplateFields. When I click the update link the Gridview returns to display mode with no errors but the data from bound text fields or dropdown list isn't...
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: David | last post by:
Under asp.net 2, if I define SqlDatasource and bind it to a grid, is selected data accessible in code? Eg. if I select s single row from the grid, can I go to the base data from the SqlDatasource...
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: John Bailo | last post by:
This is a my solution to getting an Output parameter from a SqlDataSource. I have seen a few scant articles but none of them take it all the way to a solution. Hopefully this will help some...
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.