The SqlDataSource control enables you to use a Web control to access data located in a relational database, including Microsoft SQL Server and Oracle databases. The SqlDataSource control uses ADO.NET classes to interact with any database supported by ADO.NET. You can use the SqlDataSource control with other controls that display data, such as the GridView, FormView and DetailsView controls to display and manipulate data using little or no code.
Questions tagged [sqldatasource]
967 questions
3
votes
3 answers
How can I Bind separate query to separate column in GridView Asp.net C#
I am working on ASP.net 4.0 integrated with Oracle 10.2.0.4
This is my code for GridView and its SqlDatasource

Khurram Zulfiqar Ali
- 371
- 4
- 19
3
votes
3 answers
How to get the datasource of a gridview
I am using a gridview with sqldatasource. How to get back the datasource in the codebehind as a datatable?

Geeth
- 5,282
- 21
- 82
- 133
3
votes
1 answer
SqlDataSource UpdateCommand Being Called Twice
I have a GridView that is bound to a SqlDataSource. I am running into issues with the UpdateCommand executing, it seems to be executing twice. When I step through the code in the gvChecklist_RowUpdating event, I see everything runs properly and…

Andrew
- 815
- 2
- 13
- 33
3
votes
2 answers
SQL Data Source - store procedure and return parameter
I have a store procedure in SQL Server which returns a value:
CREATE PROCEDURE [dbo].[insertProc]
@value1 INT,
@value2 INT
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO table1(value1,value2) VALUES (@value1,@value2)
RETURN…

Lukasz Lysik
- 10,462
- 3
- 51
- 72
3
votes
2 answers
Does a Sql Datasource run a select query on load if no contol binds is bound to it?
How can I configure a gridview and datasource on a page to only execute the query if the user clicks a button?
The datasource will return over 1 million records and the page will be accessed by a lot of people at the same time. One potential way to…

jgok222
- 314
- 7
- 23
3
votes
1 answer
Test the value of url parameters then Change SqlDataSource.SelectCommand from code behind c#
Hi I have a listView that I generated with a SQLDataSource, The Sql gets 2 parameters from the URL then performs a Select Query.
But I want to test the value of the parameters 1st then change the sql SelectCommand using If, else If
The Problem is my…

Liam Kenneth
- 982
- 1
- 11
- 21
3
votes
1 answer
How can I debug the parameters passed when using an inline sqldatasource?
Say I have some sort of datagrid or repeater on a .aspx page, and my data source is defined inline like:
…

loyalflow
- 14,275
- 27
- 107
- 168
3
votes
1 answer
Cascading dropDownLists in repeater. DropDownLists with SQL source and add/delete option
What is the trick to implement the following interface in ASP.NET?
I think the screenshot should explain everything.
Both dropDownLists work on SQL tables. [Categories],[Items] bound with ID_category PK/FK
Number of rows variable (by default 1…

yosh
- 3,245
- 7
- 55
- 84
3
votes
2 answers
ASP.NET SelectParameter / Control Parameter usage
newbie to asp.net here.
I am trying to setup a selectparameters and controlparameters based off textbox web controls for date ranges to retrieve data on a asp.net page.
SelectCommand="SELECT SUM(Turnover) AS TotalTurnover, (SUM(Turnover) / (SELECT…

C.F.
- 97
- 2
- 3
- 8
3
votes
2 answers
Gridview with complex sqldatasource in 3-tier architecture
I have implemented a 3-tier arhitecture which can be seen in below link
http://geekswithblogs.net/edison/archive/2009/04/05/a-simple-3-tier-layers-application-in-asp.net.aspx
In the example above it uses a DataTable as sqldatasource and binds it to…

HOY
- 1,067
- 10
- 42
- 85
3
votes
2 answers
Accessing data from my SqlDataSource in the code behind C# .net
I have a contact page where there is a datalist of people and if you click on one of them you get a contact form that I want to send to that particular person.
I use sqldatasource dscontactemail to get information about that person to place on the…
Amy
3
votes
2 answers
2
votes
1 answer
Giving user friendly exception messages
I am using the following code to handle Delete exceptions in my Formview. The trouble is I want to give the user a simple explanation should an error occur but I can't find a way to do so easily. I should say I'm new to ASP.NET. In the past I would…

gaw
- 157
- 3
- 13
2
votes
0 answers
SqlDataSource + Disabled Viewstate = Double DataBind
Here's a test page (.NET 4) I built to show the symptom I'm experiencing:
<%@ Page Language="C#" AutoEventWireup="true" ViewStateMode="Disabled" %>