Tagged Questions
0
votes
1answer
1k views
SqlDataSource SelectParameters code behind
I have a SqlDataSource feeding a ListBox with this SelectCommand:
<asp:SqlDataSource ID="DSPatients"
ConnectionString="<%$ ConnectionStrings:CSMain %>"
ProviderName="<%$ ...
0
votes
1answer
420 views
Sqldatasource connect Oracle database with parameters, code behind not working
I need set 3 parameters in SQLDatasource, binding source to the gridview.
If I remove the parameters, and directly choose datasource from design view, it shows data correctly.
I guess after pass ...
0
votes
1answer
637 views
asp.net sqldatasource parameter not supplied
OBJECTIVE: TO GET THE DELETE STORED PROCEDURE TO WORK
Hi,
I am creating a very simple CRUD (CREATE, READ, UPDATE, DELETE) test program in asp.net framework 4 which needs to have a table id as a ...
0
votes
1answer
31 views
sqldatasource, SQL doesn't run correctly
This is a strange problem that I've been working on for a while. I have a sqldatasource with select and update statements. However the statements don't work correctly with parameters.
For example if ...
0
votes
1answer
188 views
SQLDatasource Select Parameter causes time out
If I run this code, the result is returned in less than a second -
<asp:SqlDataSource ID="OrdersSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:OperationsPortal.Properties....
1
vote
2answers
513 views
How to automatically generate parameters in an ASP.NET DataSource Update Command
I'm using ASP.NET forms to build some quite lengthy questionnaires. I'm creating each page using a FormView control with an attached SQL dataSource. The select query is easy enough- Visual Studio ...
1
vote
0answers
225 views
SqlDataSource updating different fields with one UpdateCommand
I have a SqlDataSource that I would like to use for updating. I would be using two similar update commands, and I was wondering how I could do this in one SqlDataSource. I know how to do 'normal' ...
1
vote
1answer
99 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
1answer
390 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
0answers
152 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
5k 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 ...
1
vote
1answer
2k 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
266 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
3k 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
6k 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"
ConnectionString="<...
0
votes
2answers
181 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 ...
1
vote
2answers
14k 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 %>"
InsertCommand="...
1
vote
2answers
270 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
votes
1answer
381 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 ...
0
votes
2answers
1k 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
4k 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
5k 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,
...
1
vote
2answers
702 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 String<Br>...
1
vote
0answers
1k 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 ...
2
votes
0answers
101 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 ...
5
votes
3answers
20k 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
2answers
2k 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 ...
2
votes
4answers
2k 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:
"...
25
votes
9answers
86k 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 ...