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
0answers
22 views
Separate GridView column in two with condition
I have a GridView and only SqlDataSource. In my query I have 2 types of data stored in a column. First - distribution of books in our university and second - to other branchs.
I need to separate one ...
-1
votes
1answer
17 views
exeption | must declare scalar variable @IdAlbum
I am getting an error " must declare scalar variable @IdAlbum ". I have already been through similar posts on this topic but it does not help. Can someone have a look at the code below ? When i use ...
0
votes
2answers
35 views
sqldatasource select command didn't work
I have a problem doing search in asp.net, when I try to run the code in sqlserver or using query buider it works fine. But when I run the program in browser, the gridview didn't even show up. Help ...
0
votes
1answer
14 views
Bind Output Results to Variable
I am using a SQLDataSource to insert information into a database.
While it is inserting it also grabs the ID of that row
INSERT INTO InkInventory(CodeNumber, InkType, PMS, Color, Description, ...
0
votes
0answers
7 views
Advance Search using sqldatasource conflict with modalpopupextender
I have a page with 4 textbox and 1 button search. what I want to do is when I type into 1 textbox or more and when I press button search, I can get the result in the gridview. The gridview also have ...
0
votes
2answers
2k views
sqldatasource insert return identity value
Im using SqlDataSource sds = new SqlDataSource(); in code behind and inserting using sds.Insert(); Please tell me how to get inserted record primary key value?
Please note im not using stored ...
0
votes
1answer
227 views
Data Web Controls Display Value vs Insert ID (foreign key) for Stored Procedures
I've got a series of comboboxes made from ASP.NET DropDownLists (populated from a select command from an SqlDataSource by DataSourceID), and <input> element, and the jQueryUI autocomplete plugin. ...
0
votes
3answers
46 views
ASP. NET - SqlDataSource update data base
I'm learning ASP and I get stuck to update the database using asp SqlDataSource and GridView.
I have the following controls:
<asp:SqlDataSource ID="SqlDataSource1"
runat="server"
...
0
votes
1answer
8 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
10 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
38 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
35 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
699 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
811 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
82 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
28 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
49 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
8 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
936 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
45k 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
25 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
36 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
39 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
26 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
38 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
30 views
SQLDataSource Paramter not working
I have the following SQLDataSource:
<asp:SqlDataSource runat="server" ID="MySqlDataSource" ConnectionString='<%$ ConnectionStrings:RmaReportingConnectionString %>'
...
0
votes
0answers
16 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
55 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
804 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:
...