Questions tagged [sqldatasource]

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 with other controls that display data, such as the GridView, FormView and DetailsView controls to display and manipulate data using little or no code.

967 questions
0
votes
1 answer

Validating with SQLdatasource - C#

I am using visual studios 2010, and I have added a database and connected to it with SQLdatasource. I'm creating a basic login. I want the user to enter the login, and when he tries to login, I want to interate through the database and check if the…
user1005253
  • 404
  • 2
  • 7
  • 21
0
votes
2 answers

Add Stored Procedure Parameter into sqlDataSource, msSQL

I want to insert a value by using stored procedure in mssql. This is my stored procedure : ALTER PROCEDURE dbo.insertNewMember (@name varchar(30), @age int ) AS BEGIN INSERT INTO member(memId, name, age) VALUES ('', @name, @age); END My C#…
Shnkc
  • 2,108
  • 1
  • 27
  • 35
0
votes
6 answers

Can't Update with sqlcommand and Parameters

I have some trouble to update my sql server 2005 database when i use parameters.Here you can see the code that normally has to work.I precise that i already make others treatments such as insert into and it worked…
Quentin91360
  • 122
  • 1
  • 3
  • 19
0
votes
1 answer

How to get value from dataTable of a column that has a dropdownlist control in the gridview?in row updating event

How can I get the value from data table of the gridview for a specific column where the control is a dropdownlist.So I don't want to get the dropdownlist value I want to get the value for the column that is set in the datatable. I need it in row…
Alexander
  • 187
  • 2
  • 5
  • 15
0
votes
1 answer

Is it possible to have a SQLDataSource with a parameter that is based only upon the GridView that is binding to it?

I have a scenario where I want to put four identical Gridviews on the same page. (They will be on different tabs in an Ajax TabControl.) They show the same source data, but there are four corresponding groups of source data in a common underlying…
J Shantz
  • 1
  • 1
-1
votes
2 answers

Error in parameter that i use in update command in sqlDataSource

I use below code : .aspx
SajjadZare
  • 2,487
  • 4
  • 38
  • 68
-1
votes
1 answer

"Must Declar Scalar Variable" Error even though I added it using Select Parameters

SqlDataAdapter adpReport; DataSet dsReport; ReportDataSource rds = new ReportDataSource(); strSQL = "SELECT ********* WHERE Facility.FacilityId = @FacilityID and DirectDepositRejections.TransactionDate >= @txtFromDate And…
brianw921
  • 1
  • 2
-1
votes
1 answer

Could not find control 'DropCity' in ControlParameter 'City' ERROR

Context: I am trying to nest two dropdownlist(ddl) inside a gridview, the first ddl is called "Ciudad" and the second one is called "Comuna", I want that according to the "Ciudad" I choose the "Comunas" change to that corresponding "ciudad". but I…
Sr Canito
  • 3
  • 2
-1
votes
1 answer

Please correct this QueryStringParameter

<%#Eval("RegNo")%>
The
  • 13
  • 3
-1
votes
1 answer

Visual Studio 2017 & 2019 SqlDataSource "Cannot Connect - Object Reference not set to an instance of an object"

I am working on a project for my graduate classes and need to use gridview to populate data from mysql and then populate links to edit and delete said data. I cannot seem to find the answer anywhere online to this problem. The connection string was…
Brooke
  • 109
  • 1
  • 2
  • 12
-1
votes
2 answers

SQLDatasource parameters problem

Why if i use the following instruction in the code behind: SqlDataSource1.SelectParameters["page"].DefaultValue = "0"; I get 'System.NullReferenceException: Object reference not set to an instance of an object. '?
hhh3112
  • 2,167
  • 10
  • 36
  • 55
-1
votes
1 answer

asp.net c# Repeating only 1 of 3 images related to record

i want to repeat out all items from a single category (selected via querystring) which currently works. However, each item is currently shown (repeated) 3 times, all 3 with the same text just a different image, because each item has 3 different…
tekar
  • 93
  • 1
  • 13
-1
votes
1 answer

which datasource doesn't supports caching in asp.net

we have different data sources like sqldataource objectdatasource linqdatasource xmldatasource Out of which doesn't supports caching
-1
votes
2 answers

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.
-1
votes
1 answer

Exception | 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 command paramters it gives me error. If I do not use…
Azfar
  • 33
  • 6