Tagged Questions

10
votes
7answers
29k 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 ...
2
votes
4answers
1k views

Getting 'too many parameters passed' to stored procedure on ASPX page

I'm having trouble figuring this error out. I have a grid on an ASPX page that displays data from a stored procedure in an SQL Server 2008 database. When the page loads, I get the following error: ...
2
votes
0answers
74 views

Automatic creation of parameters with the SqlDataSource Control

I've recently converted an existing web application from 3.5 to framework 4.0 and noticed a page stopped working - with an "incorrect number of parameters" error. Page is fairly simple and has a ...
1
vote
2answers
328 views

SqlDataSource Parameter Problem - Using loginName1 as sql parameter

I am trying to retrieve database info that is specific to currently logged-in user. The following 3 lines let me know that var1 is correct (As it displays it on the page) Dim var1 As ...
1
vote
2answers
159 views

ASP.NET / C# SqlDataSource commands and parameters based on table

Is there any way to generate CRUD commands and parameters for SqlDataSource based on table name? Idea is to make only one page for handling lookup tables, which can have different columns, so ...
1
vote
0answers
524 views

ASP.NET BoundFields not setting UpdateParameters

I have a few bound fields, but they don't seem to be setting the UpdateParameters for my SQL statement. I do have some code that runs on SqlDataSource Update to set UpdateParameters for non bound ...
0
votes
2answers
2k views

Setting the value of insert parameter of SqlDataSource in codebehind

I have this SqlDataSource in my form: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ...
0
votes
3answers
5k 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
122 views

Setting today as an ASP.Net SqlDataSource insert parameter default value

Using this ASP.Net we would like to see today's date appear in a date Textbox when the user clicks the "New" button of a DetailsView so they can see the date in the Textbox prior to actually inserting ...
0
votes
2answers
800 views

How to set parameters for SqlDataSource UpdateCommand

For a Gridview: I am trying to use a stored procedure for the first time in a SQLDataSource for the UpdateCommand: <asp:SqlDataSource ID="TECT_DataSource" runat="server" ...
0
votes
2answers
464 views

Change Gridview Datasource or Select statement ijn code?

I have a gridview with sqldatasource, etc. For the grid, I also have a search textbox. If the user needs to filter the records, I want to dynamically adjust the SELECT statement for the SqlDataSource ...
0
votes
2answers
707 views

Grab query results from SqlDataSource and store as string

I have a SQL query that will result in one string. Rather than bind a gridview, listview, etc to it and have a single lonely label inside, I just want to store the string (it'll eventually get used ...
0
votes
1answer
1k views

ASP.NET SqlDataSource parameter declaration in code behind

I'm implementing SqlDataSource in code behind. Here is my code: var sqlDataSource = new SqlDataSource { ConnectionString = _constr, ...
0
votes
0answers
17 views

databinding with parameters to oracle via sql

We have a linked server set up in SQL Server to an oracle server. I need to populate a gridview with some data. But I find that when I use a parameter with the datasource the query is very slow. ...
0
votes
1answer
60 views

Delete parameters in SqlDatasource in asp.net

i have a Gridview which is connected with SqlDataSource for Data. I have Edit and Delete built in functionality. I have passed the Stored Procedure for the SelectCommand. Now i want to delete record ...

1 2
15 30 50 per page