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 ...
0
votes
1answer
7 views
Asp.net sql or object-datacontrol select parameter having both DefaultValue and ControlParameter
I would like expert advice about what actually occurs when a sql or object select parameter is given BOTH a DefaultValue AND ControlParameter reference in the aspx code.
In example below, the ...
-1
votes
1answer
7 views
asp.net SqlDataSource select statement with IN (…) clause
I need to pass a server-side parameter to my SqlDataSource SELECT IN-clause as follows (notice the parameter @InClause and it's location in the SQL-select that is defined in the aspx (for the ...
-2
votes
1answer
179 views
When I try to insert data from textboxes to SqlDataSource, it gives me error “Object reference not set to an instance of an object”
protected void btnInsert_Click(object sender, EventArgs e)
{
string custName = ddlCustomerName.SelectedValue;
string listing = ddlListing.SelectedValue;
...
1
vote
5answers
6k views
Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified
I have an ASP button link in GridView1 that should delete an item from a db table on click, and I am getting this error message:
Deleting is not supported by data source 'SqlDataSource1' unless ...
1
vote
0answers
4 views
1
vote
1answer
33 views
How to generate the needed SQL statements to Update, Insert, Delete data in GridView?
I'm using GridView along with SqlDataSource, for selecting, updating and deleting,
and DetailsView for Inserting, the problem is, when I click one of these buttons, I get this error for the Delete ...
0
votes
1answer
34 views
Overload/Override SQLDataSource Update Events
I have a SqlDataSource that loads/selects the User and role information from an ASP.net side quite well. I like the ability to take advantage of the auto generated edit/update link buttons that are ...
0
votes
0answers
20 views
How to update UpdatePanel when selected value of dropdown change from code behind?
My drop down are linked with each other and I am using update panel and sqldatasource and I want to update Update Panel when set selected value of drop down from code behind.
Protected Sub ...
0
votes
2answers
694 views
Error in parameter that i use in update command in sqlDataSource
I use below code :
.aspx
<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ConnectionStrings:Con %>" runat="server"
SelectCommand="select * from DorePayvar" ...
0
votes
2answers
1k views
Having trouble in Datasource for Telerik RadGrid
I am a bit stuck with codes and need your help.
Since my RadGrid holds RadAsyncUpload to save the file in file system therefore I have to configure my datasource in codes :( ... or you can say this ...
1
vote
4answers
810 views
How to use a property of an object in asp:SessionParameter
I am trying to get an asp:SessionParameter of a SelectParameters, to use a property of an object in session
instead of having a string in the session like Session["CustomerID"]
Something like ...
0
votes
2answers
81 views
How can I save the result of an SQLDatasource query into a variable in c#?
My query result supposedly is a string and I want to save it into a string variable and print it out. But the result is: System.Web.UI.WebControls.SqlDataSource
using this code: ...
0
votes
1answer
25 views
SqlDataSource UpdateParameters - Input string was not in a correct format
I have inherited some ASP.NET code that I need to update which has resulted in my needing to change the ASP SqlDataSource's UpdateCommandType from a string (hard coded SQL Update statement) to a ...
0
votes
2answers
42 views
get Sum of values in column from sqlDataSource
I have a SqlDataSource dsDetails that selects from the DB table.
<asp:SqlDataSource ID="dsDetails" runat="server" SelectCommand="spGetDetails"
OnSelected="dsDetails_Selected" ...
1
vote
1answer
16 views
SQL Show most current record for each task by date
I want to show the most recently updated record for each task.
Currently I am only getting the most recent of all records no matter what task.
Here is the front end code
<asp:SqlDataSource ...
0
votes
0answers
23 views
Can't solve - C# SQL checking two tables and updating one
I'm trying to update a Modules table, when the user selects a course they're brought to a modules page, then they search for lecturer and select him/her.
So I know it updates my table, (because I ...
7
votes
8answers
32k views
How can I set the sqldatasource parameter's value?
I'm trying to set the value of the sqldatasource's selectcommand parameter @ClientID as in the code below, but it's not working out.
My code:
Dim strCommand = "SELECT caller_id, phone, name, email ...
5
votes
2answers
8k views
how do I check that a SqlDataSource returned data?
I have an asp.net page that has several SqlDataSources defined that feed data into some graphs. The graph product does not handle "no data" gracefully, and throws an exception. I'd like this to handle ...
0
votes
0answers
7 views
Change to different SQL Server database in Visual Studio 2013 project
I have a VB.NET project in VS2013. In it I have several DataGridViews populated by a SQL Server 2012 database. The DGV and connection has all been set up with the wizards, so I have BindingSources, ...
0
votes
0answers
866 views
Tableau: Filtering Across Multiple Data Sources
My data is coming from Microsoft SQL Server Management studio.
I was trying "Filtering Across Multiple Data Sources" by following the instructions provided in the link:
...
0
votes
0answers
22 views
parameterise table name in nested repeaters datasource
i want to select a column like cl1 from different tables for each row on gridview and show it on my repeater. how can i do this?
here is my code:
<asp:gridview cssclass="text-center table ...
1
vote
0answers
1k views
java connection pool autocommit
I'm using for the first time the connection pool in java. The application that I'm writing is a web application deployed on oracle glassfish 3.1 and the resource connection pool is handled by it. I ...
7
votes
4answers
33k 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 ...
0
votes
1answer
21 views
SqlDataSource control and SQL Injection
I'm testing a web page to prevent SQL Injection.Here is my ASPX page source:
<asp:SqlDataSource ID="SqlDataSource_Test" runat="server"
ConnectionString="<%$ ConnectionStrings:Default ...
1
vote
2answers
10k views
bind sqldatasource result to textbox c#
I have a SqlDataSource that returns 1 field (1 row) for an ID. I would like to get that result and display it in a TextBox. I would normally do it using a stored procedure (since the stored procedure ...
4
votes
5answers
44k views
How to clear exisiting dropdownlist items when its content changes?
ddl2 populates based on ddl1 selected value successfully.
My issue is the data that is already present in ddl2 does not clear before appending the new data so ddl2 content just continues to grow ...
0
votes
0answers
22 views
Naming parameters for stored procedure based UpdateCommand in ASP.NET SQLDataSource / FormView
I'm using a SQLDataSource object to edit data of a MYSQL table.
The ASP.NET form uses a FormView and fields are mapped onto controls through <% #Bind('field_id') %> directives.
The form is ...
0
votes
1answer
35 views
Nesting Gridview inside Formview breaks insert codebehind context
I have a couple of GridViews in my FormView page and I am wanting to make an Insert row in the FooterRow of the Gridviews. Layout and everything is fine. However, as I'm building the codebehind for ...
2
votes
1answer
37 views
Detailsview templatefield mapping to ObjectDataSource?
I need help to understand the proper way to map or associate TemplateFields to the ObjectDataSource. I show only one (of many) template definitions here:
<asp:TemplateField HeaderText="First ...
24
votes
5answers
41k views
asp.net dropdownlist - add blank line before db values
On my page I have a DropDownList which I populate with database values from an SqlDataSource (see code below).
How can I add my own text or a blank line before the values?
<asp:DropDownList ...
8
votes
3answers
8k views
How to use User.Identity.Name as a parameter for SqlDataSource in ASP.NET?
For SqlDataSource I can configure the external source for the incoming paramater.
For example it might be a QueryString, Session, Profile and so on.
However I do not have an option to use User as a ...
1
vote
0answers
23 views
How to we use the control inside RadGrid edit field as Select Control parameter Control id
I had a textbox control inside radgrid edit template, I want to use it as sqldatasource select parameter ControlID .
<SelectParameters>
<asp:ControlParameter ControlID="" ...
0
votes
3answers
2k views
How do I default all my SqlDataSource parameters to convert empty string to null?
I have a project that utilizes a number of FormViews and SQLDataSources. I would like the default behavior of the SQLDataSource to insert values that are empty as null. I know I can do this by ...
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 ...
-1
votes
2answers
8k views
Assiging parameters to sqldatasource
I'm trying to get data from SQL Server and use it in a formview, but the formview control won't get any data from the datasource.
(The datasource gets parameter on page load)
Output is just: "There ...
0
votes
1answer
33 views
Gridview doesn't refresh after deleting a row
I have a GridView in an UpdatePanel.
When I add a row, it gets updated right away. The problem is that, when I delete a row, it doesn't update the GridView.
What can be done?
protected void ...
1
vote
2answers
29 views
SQLDataSource Paramter not working
I have the following SQLDataSource:
<asp:SqlDataSource runat="server" ID="MySqlDataSource" ConnectionString='<%$ ConnectionStrings:RmaReportingConnectionString %>'
...
0
votes
0answers
15 views
SqlDataSource using the client-side variable
I am using the SqlDataSource with sql query to provide the datasource for DataGrid. Using general query or stored procedure is fine. However, can I used the client-side variable, for example ...
2
votes
1answer
10k views
setting the default value for insert parameters in sql datasource asp.net
i have a datasource, which has an insertparameters, one of which whose type is set to Boolean, but while adding it from code behind insertparameters.defaultvalue always return string.
code behind ...
0
votes
1answer
52 views
ASP.NET GridView won't populate from changing SqlDataSource.SelectCommand if Textbox is empty
I'm using a Textbox and a DropDownList to filter database searches. I'm using an SQLDataSource with a blank SelectCommand and then setting the command in the codebehind depending on what the user has ...
0
votes
1answer
27 views
Cancel SqlDataSource selecting rows when SelectCommand timeout
How can I cancel selecting rows in SqlDataSource when SelectCommandtimed out?
I know that I can set CommandTimeout property but I want to Handle error and force Page to continue running when ...
3
votes
3answers
551 views
'DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value
I'm using TemplateField in GridView to implement edit/delete from database.
I'm Querying Data with the SqlDataSource Control.
when I edit the Table from page I get following error:
...
1
vote
1answer
234 views
Create SqlDataSource Filter Parameters from code behind
I`m trying to fill a gridview from a SalDataSource from code behind.
I want to filter the results using 3 text boxes: ScheduerName, Username and Summary.
My wish was to keep the aspx page as simple as ...
0
votes
5answers
9k views
change the font color gridview row based on a columns value. cant index gridviewrow?
i am getting a syntax error at drr(5) which 5 is the column i want to base the color change on.
this method works when i am using a dataset
Dim Land As String = "Land"
Dim Air As ...
-1
votes
1answer
40 views
how to write delete query in multiple selection?
I have a gridview in my web project and I connect it with the SqlDataSource. The select command contain fields from 3 table, and I created commandField for gridview so that users can delete their ...
0
votes
3answers
1k views
When delete button is pushed on gridview throws Must declare the scalar variable “@Content”
I am trying to enable deleting in grid view. When you run this code and press the delete button you get the error Must declare the scalar variable "@Content".
Code
<asp:GridView ...
1
vote
0answers
31 views
SqlDataSource control is hidden in ToolBox of Visual Studio 2012
I'm a fresher started my career with SharePoint. I created a visual web part and tried to bind data with grid view of a SqlDataSource. But I cant see the SqlDataSource control in the toolbox and its ...
0
votes
2answers
37 views
SqlDataSource requery on button click
I've got an issue with asp:SqlDataSource. I'm trying to pull some data based on a start and end date. I want this data to pull the last 24 hours on load but right now I'm just trying to pull it all ...
0
votes
1answer
45 views
SqlDataSource UpdateCommand is not working
I have a GridView and its DataSource is a SqlDataSource.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
...
1
vote
1answer
55 views
VB SQL Insert Query Inserts NULL for all values
I'm developing an asp.net application in Visual Web Developer and I am trying to Insert a new row into the database. I currently have an "Insert" row that is in the Footer Template of a GridView. The ...