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 ...

learn more… | top users | synonyms

1
vote
2answers
2k views

What is the difference between DbType and Type in SqlParameter?

Can you explain me the difference between Type and DbType in a parameter of a datasource? What is the best pratice of assigning these two properties?
1
vote
2answers
25 views

How to assign a radiobuttonlist to a boundfield in GridView?

I imported an excel table consisting of 5 columns and 50 rows into a datatable and stored it in a database table. None of the columns are a primary key as they consist data of string, are repetitive ...
0
votes
0answers
14 views

Parameters of SqlDataSource from ComboBox with System.Data.OracleClient

Hi I have an ASPxGridView with a DataSourceID called SqlDataSourceGridViewLog: <asp:SqlDataSource ID="SqlDataSourceGridViewLog" runat="server" SelectCommand="SELECT USERNAME, TIME_INSERT, IP, ...
0
votes
2answers
49 views

If SQLDatasource returns 0 rows, change display:none to display:block

I have a table with content that says 0 orders found That is currently set in css #OrderNoExist { display:none; } I'd like for the C# to change the css style for this table to block. ...
0
votes
0answers
18 views

Cross FormView fields update

I have an ASP.NET page (C# codebehind) with two FormView both of these are bound to the same underlying SQL table but SQLDataSource objects feeding the forms are different because I needed two ...
0
votes
1answer
21 views

How to stop Visual Studio Query Builder from re-writing SQL (VS2005)

I simply paste this SQL code that I've carefully crafted in SQL Server Management Studio and it works. SELECT v.StudentID, v.StudentName, s.StudentHomeEmailAddress, s.StudentStudyYear, ...
1
vote
2answers
31 views

SqlDataSource ControlParameter not working

I have a dropdown (selProject) populated by a SQL table. The value is the id field, the name is the name field. I have a gridview control fed by a sqldatasource. What I want to do is to conditional ...
0
votes
0answers
19 views

Error uploading InfoPath form to Sharepoint 2013: “Object reference not set to an instance of an object”

The only change we've made is added an additional data connection to a SQL database and then filter on the data connection to set a field. The form is fine when you query the database only but when I ...
0
votes
1answer
51 views

Send float parameter through SqlDatasource.InsertParameter

Hi I am trying to insert a float value into database through SqlDatasource.InsertParameter but after SqlDatasource.Insert() function is executed I only see the Integer part of it inserted in database. ...
1
vote
2answers
3k views

How to convert asp.net NULL value to “” (blank string)

I have a situation where I am using a detailsview with the SQLDataSource to update a record in an SQL Server Database. My issue is that textfields that are not completed are converted to NULL in the ...
0
votes
2answers
7k views

Update is not working on GridView

Hey guys, I have a GridView which is binded to SqlDataSource, everything works fine, just update does not works, i am calling stored procedure, and all parameters and its dataTypes are proper, ...
1
vote
1answer
1k views

Using ASP.NET UpdatePanel with SqlDataSource

I'm currently involved in adapting an existing website. In the website we have a page that uses a formview and some SqlDataSources to get data from the database. On this website I need to have a link ...
2
votes
1answer
852 views

UpdateParameter Not Working

I am trying to set an update parameter manually. The command executes successfully and I can pull the data back to confirm that the parameter was set correctly. However my SQL update statement will ...
-1
votes
2answers
40 views

How do I dynamically remove items from the checkboxlist

I have a CheckBoxList which is bound by an SqlDataSource control. I want to remove some items from that list according to some conditions when the page loads.
3
votes
2answers
46 views

Different SQL Datasource on Dropdownlist Selected Index Change

I have a Grid view and I want to use Two different Sql DataSources on Selecting different values from DropDownList i.e. On Selected Index Change. Please help me How should I implement that??? I don't ...
1
vote
1answer
1k views

sqldatasource default value

How do I set the default value of a SQLdatasource parameter to the select all <asp:Parameter Name="original_lastsaved" Type="string" defaultvalue="???"/> Thanks for the help. saurabh
0
votes
2answers
359 views

Delete Item From Dynamic Gridview

I have a dynamic gridview with data pulled from oracle database. <asp:GridView ID="gvData" OnRowDataBound="gvData_RowDataBound" OnPreRender="gvData_PreRender" ...
0
votes
1answer
1k views

Sending variables to sqldatasource

I have an sqldatasource that takes a stored procedure with a parameter..But that the stored procedure doesnt get executed... Am I passing the parameter successfully? SQLDataSource: ...
1
vote
1answer
22 views

SqlDataSource throwing “Specified cast is not valid” error on data pulled from Oracle

This SqlDataSource, which is pulling from an Oracle db, throws "Specified cast is not valid" ONLY when I include c.item_cost in the SQL. If I remove this column, no error. It does not matter if I ...
4
votes
2answers
913 views

How to sanitize a query string when used with a databound repeater control?

Given the following URL: domain.com/page.aspx?id=123 How can I sanitize that query string value when it is used on a Databound Control such as a repeaters SqlDataSource? <asp:SqlDataSource ...
0
votes
1answer
5k views

ASP.NET login validation with database

I have login in my asp page req name/pass and button. I create the connecttion string to my database and SqlDataSource with the query well here in the SqlDataSource: <asp:SqlDataSource ...
0
votes
1answer
560 views

Setting DataKeys for Custom GridView

I have a GridView that is customized by each page that uses it. The issue I am having with this is that I cannot explicitly set what the DataKeys are (since each page will have different ones -- and ...
0
votes
1answer
32 views

Separate GridView column in two with condition

I have a GridView and only SqlDataSource. In my table 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
19 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
36 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
10 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
53 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
12 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
14 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
7k 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
1answer
48 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
47 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
21 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
708 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
829 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
91 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
38 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
67 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
17 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
33k 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
10 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
1k 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: ...