12
votes
7answers
32k 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
85 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
1answer
13 views

Decimal value become another value

Why when i pass this parameter to sqldatasource parameters i see the correct defaultvalue but an incorrect parameter value? i don't know the difference between these two types of parameters, i Always ...
1
vote
2answers
390 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
1answer
35 views

How to pass string value to storedp procedure that want decimal value

i have this problem and I don't know how to solve: -in an .aspx page a SqlDataSource calls a stored procedure -i pass parameter in code-behind -i have to pass string value but the parameter is ...
1
vote
2answers
202 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
661 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
3k 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
1answer
2k 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
3answers
6k 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
910 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
1k 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
550 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
1k 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
0answers
45 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
250 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 ...
0
votes
1answer
111 views

Set Sqldatasource parameter dynamically

I have create a gridview and a SqlDataSource, which has parameter in the where clause, which has a source in a dropdown menu. That works fine. I also have an input textfield. I would like the value ...
0
votes
1answer
850 views

Cannot get SqlDataSource.SelectParameters.Add to work

I am trying to change the parameter of an SqlDataSource on the fly, but the code seems to fail, or in other words I seem to fail. Here is the code: int id = 0; SqlConnection conn = ...
0
votes
2answers
106 views

Editing parameters in sqldatasource

I want to create a dynamic select command in an SQLDataSource. It should read a value from the URL sent using get, grab it and stick it into the select command. My sqldatadource is in my aspx page ...
0
votes
2answers
1k views

ASP.NET - Use a checkbox to change the results of a SqlDataSource

I'm using Visual Web Developer 2010 Express. This is my first attempt at creating a .NET page. I have a Gridview on a page that displays the results of a GridQuery. This works. I have a checkbox ...
0
votes
0answers
809 views

Can I populate multiple DropDownLists from one SqlDataSource using parameters?

Basically, I have four asp:DropDownLists and I wish to populate all of them from the same table, with certain conditions. For example, I have this data source: <asp:SqlDataSource ...
-1
votes
1answer
153 views

Stored procedure not executed when string is empty

I've got a really weird problem and I can't seem to find a solution to it. I've got an SqlDataSource with a set of parameters and a select command in form of a stored procedure. One of the ...