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 ...

learn more… | top users | synonyms

12
votes
7answers
34k views

How to pass variable to SelectCommand of SqlDataSource?

I want to pass variable from the code behind to SelectCommand of SqlDataSource? I dont want to use built-in parameter types (like ControlParemeter, QueryStringParameter, etc) I need to pass a ...
10
votes
3answers
4k views

SqlDataSource vs ObjectDataSource

If a web page needs some data, why not just have a SQLDataSource call a stored procedure? Why use an ObjectDataSource to call a business object that then calls the stored procedure? I understand that ...
-1
votes
1answer
1k views

How to get sqlserver database name from datasource name in Java

As specified in the title, I want to get the database name in sqlserver, all info I know is datasource name, login name/password to get the Connection object, please show some pointers on how to ...
3
votes
2answers
13k views

Changing SqlDataSource.SelectCommand at runtime breaks pagination

I have a GridView bound to a SqlDataSource with a default SelectCommand defined as such: <asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataSet" ...
3
votes
3answers
12k views

How to set SelectedValue of DropDownList in GridView EditTemplate

I am trying to do this as asked earlier. The only difference that I found is additional List item that was included in above code. I tried to use AppendDataBoundItems=true but it is still not ...
2
votes
4answers
17k views

How to sort columns in an ASP.NET GridView if using a custom DataSource?

I can't get my GridView to enable a user to sort a column of data when I'm using a custom SqlDataSource. I have a GridView in which the code in the ASP reference to it in the HTML is minimal: ...
0
votes
2answers
293 views

Using C# SQL Parameterization on Column Names

I'm having a problem. I want this to work, but it doesn't: SqlDataSource.SelectCommand = "SELECT blah1, blah2 FROM myTable WHERE @ColumnName = @Value"; ...
5
votes
2answers
1k views

Gridview why all visible rows are set to dirty?

I'm using the BulkEditGridView control as discussed http://roohit.com/site/showArc.php?shid=bbb62, and it's perfect for my needs. The problem I'm having is that whenever I save, every visible row (I ...
0
votes
3answers
5k views

SqlDataSource SelectCommand using LIKE does not work

I have the following T-SQL in a SelectCommand: SELECT h.Business, hrl.frn FROM registration hrl INNER JOIN holder h on h.call = hrl.call WHERE (h.Business like '%' + @business + '%' and h.Business ...
1
vote
3answers
443 views

“Server” vs “Data Source” in connection string

I'm new to SqlServer, right now I have SqlLocalDb installed to work locally. Good, but I can see two connection strings typically and both works: Data Source=(localdb)\v11.0;Integrated Security=true; ...
1
vote
2answers
4k views

SqlDatasource select parameters

Here is my sql datasource details <asp:SqlDataSource ID="dsMoodleQuiz" runat="server" ConnectionString="<%$ ConnectionStrings:OnlineMeetingConnectionString %>" ...
1
vote
2answers
3k views

How to add Item to SqlDataSource databound list

I am lazy - and I am using a SQLDataSource to populate my dropdownLists. The Databind event for the databound objects is called before the Page.PreRender so I am doing something like this in the ...
0
votes
3answers
7k views

How to specify parameter value for stored procedure in SqlDataSource

Being new to using the declarative syntax of SqlDataSource I am trying to figure out a way to set the value of a parameter to a stored procedure. I have a Client_ID that is passed via the Request ...
0
votes
1answer
3k views

If DataBind() is called inside Page_Load(), then SqlDataSource doesn’t perform updates

If I bind GridView (via DataSourceID attribute) to SqlDataSource and set SelectCommand and UpdateCommand attributes, then everything works perfectly. But I’ve noticed that if I, for whatever reason, ...
8
votes
5answers
19k views

asp.net dropdownlist - add blank line before db values

On my page I have a dropdownlist which gets populated by database values from an SqlDataSource(see code) How can I add my own text or a blank line before the values... <asp:DropDownList ...

1 2 3
15 30 50 per page