Questions tagged [selectcommand]

48 questions
4
votes
2 answers

Changing SqlDataSource.SelectCommand at runtime breaks pagination

I have a GridView bound to a SqlDataSource with a default SelectCommand defined as such:
Mark Richman
  • 28,948
  • 25
  • 99
  • 159
3
votes
2 answers

The conversion of nvarchar value "0854697543" overflowed an int column in select command

I have a select command, and it returns answer records, but it also gives an error in Visual Studio 2010's query builder with this query: SELECT * FROM Orders WHERE (BCode = 025) AND (Date BETWEEN '1390%' AND '1391%') OR (Date BETWEEN…
hamze
  • 7,061
  • 6
  • 34
  • 43
3
votes
2 answers

How to print count table query of bigquery in python?

I am trying to print count of rows available in table of bigquery in python,I have written below code: from google.cloud import bigquery def main(): myquery = "select count(*) from `myproject.mydataset.mytable`" client = bigquery.Client() …
Kaustubh Ghole
  • 537
  • 1
  • 10
  • 25
3
votes
5 answers

"Arithmetic operation resulted in an overflow." getting this error in ASP.Net after converting to the Azure project

I am working on an asp.net application. Now I am working on to move it to windows azure server. After converting the project to the windows azure project it gets started to give me errors in accessing the database. I am able to access the data but…
jkmehmi
  • 66
  • 1
  • 8
3
votes
1 answer

GridView - Client Side "WHERE" clause in the SqlDataSource?

I have a GridView with a TemplateField containing a button. This button opens up a modal window which contains another GridView as seen below: Template Field in Gridview1:
Johnathan
  • 879
  • 3
  • 12
  • 22
2
votes
2 answers

How to get the ListItem based on the column name in ASP.net?

I have a drop down list box like following. Under some condition, in the databound event I want to remove the items whose bitActive is set to 0 (inactive). I did not put a WHERE bitAcive!=0 in the selectCommand, because I only want to remove them…
GLP
  • 3,441
  • 20
  • 59
  • 91
2
votes
4 answers

SelectCommand with Parameters provides empty result

Currently I will clean my code a little bit and VS told me, it is better to use the SqlParameter for the sql commands instead a compound string. So I decided to change my code, unfortunately now I don’t get a result and I don’t know why. Here is the…
Andre Hofmeister
  • 3,185
  • 11
  • 51
  • 74
2
votes
2 answers

How to get selected item in ASP.NET GridView

How can I get the selected item on the SelectedIndexChanging handler when using two SelectCommands? I can get the selected row through e.SelectedRow but I'm unable to get the selected column. It's correct to have more than one SelectCommand in a…
Diogo Cardoso
  • 21,637
  • 26
  • 100
  • 138
2
votes
1 answer

Declaring an object of a conditional type with a System.Type

I am attempting to launch a specific form depending on the selected node of a treeview on the doubleclick event. The code I need to use to launch the form is a little bulky becuase I have to ensure that the form is not disposed, and that the form…
Caleb Hearth
  • 3,315
  • 5
  • 30
  • 44
1
vote
3 answers

Passing NULL SQL parameter values as SelectParameters bound to a Gridview

The following SQL query WORKS perfectly in SQL Management Studio: DECLARE @phone AS varchar(25) SET @phone = NULL DECLARE @firstname AS varchar(25) SET @firstname = NULL DECLARE @lastname AS varchar(25) SET @lastname = NULL DECLARE…
John Batdorf
  • 2,502
  • 8
  • 35
  • 43
1
vote
2 answers

asp.net SelectCommand SQL JOIN problem

I'm a database noob so please bear with me. I'm trying to join three tables together in the SelectCommand attribute of a SqlDataSource. Here's my select command at the moment: SelectCommand="SELECT DISTINCT a1.[CreateDate], a2.[UserName], c1.[name],…
melat0nin
  • 860
  • 1
  • 16
  • 37
1
vote
1 answer

SqlDataSource - SelectCommand with session variable filter

ASP.NET 2.0 framework I'm trying to list all user related entries when the user visits the page. I have a session variable set with the visitor in session. Now I want to query the database with that ID. It seems to be executing, but no results are…
Kana
  • 13
  • 5
1
vote
2 answers

Parameterized Query Build Error

Why aren't my parameterized variables being added to my Sql query? I have two parametrized variables set by combobox.text which is selected by the end user. I get the error below when trying to use a query that uses a parameterized…
Dan Cundy
  • 2,649
  • 2
  • 38
  • 65
1
vote
1 answer

Can I connect to multiple servers with an asp:SqlDataSource?

I have a repeater table in an asp.net application bound to an asp:SqlDataSource, and I need that data source's SelectCommand to select data from two databases in different servers. I've been using the ConnectionString property of SqlDataSource to…
1
2 3 4