473,856 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unexpected SQLDataSource Results

I have a grid view bound to a SqlDataSource control. The grid view is empty
(shows my empty-data template) when I expect it to have rows.

I set a breakpoint in the data source control's Selecting method and
examined the select command along with the three parameters that I've
specified. If I copy the command to an editor and replace the named
parameters with the values, and paste the result into a SQL query, I do in
fact see the rows I expect.

The only "fudging" I had to do was surround the Guid argument with single
quotes. And then it works fine.

Is there any way I can look to see exactly what query is being created so I
can try and determine what is wrong? I get no errors.

Thanks for any thoughts.

Jonathan

Sep 17 '08 #1
1 849
"Jonathan Wood" <jw***@softcirc uits.comwrote in message
news:eE******** ******@TK2MSFTN GP03.phx.gbl...
Is there any way I can look to see exactly what query is being created
http://msdn.microsoft.com/en-us/library/ms191006.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 17 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5049
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my select, remember it, and then use it in the update. It works just fine when I have full control of the whole process. I want to do the same for my GridView/SqlDataSource combinations. I typically select from a view and update the corresponding...
1
8436
by: VB Programmer | last post by:
Asp.net 2.0... I have an SqlDataSource on my aspx form. It's defined as... <asp:SqlDataSource ID="sdsCoupons" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT ShoppingCoupons.*, CouponCode AS Expr1 FROM ShoppingCoupons WHERE (CouponCode = @CouponCode)"> <SelectParameters> <asp:ControlParameter ControlID="txtCouponCode" DefaultValue="000"
1
5422
by: VB Programmer | last post by:
I have a SqlDataSource I setup on an ASP.NET 2.0 webform. I setup the SELECT statement and it has 1 parameter, @ProductId. How do I, using VB.NET, store the results of that SELECT statement into a datatable or dataview, for example? Here's partial code... Dim ds As New DataSet Dim dv As New DataView
0
2261
by: Brew | last post by:
Hello, I'm writing an ASP.NET 2005 (VB) Website with an Oracle 9i backend I have an oracle package with stored procedures and functions I need to use from the VB Code, I'm trying to use the SQLDataSource to call a stored procedure passing parameters and then displaying the results on a GridView control my trouble is with the parameters and displaying results into the GridView.
0
1026
by: JR | last post by:
I have a question with SqlDataSource controls. I have a SqlDataSource control that has a select, insert and update parameters defined. This is running with Visual Studio 2005 Team system and Net Framework 2.0. My problem is I want to get the last generated Identity field from a table =IDENT_current('tblname')=. I can put this command in the Select Command but when I try execute it it wants more parameters. Example:...
1
1266
by: David Lozzi | last post by:
Howdy, I've decided to try and use the gridview and a sqldatasource. When I add the sqldatasource connection (to MSDE 2000) and press save, I get "Visual Studio has encountered an unexpected error." and it then makes me save it as a different file name. When I save it as a different name, and make some other changes to the gridview or a label, then hit save, it errors again and wants to save it as a different name again. I've run Windows...
0
1628
by: jobs | last post by:
I have a gridview that times when selecting from specific table when I try to when I add a where clause. Even when I'm only seleting Top 1 which comes right back at the command line. I test the below code with two different tables in the datasource for the gridview, one works the other times out. If I perform the same query in sql server manually both tables work fine and fast. if I hard code the where clause in the asp.net the code...
0
2142
by: LiamLiamLiam | last post by:
G'day all. I having a problem with my formview. I'll ty to explain my situation as best as i can. I have a page with a search field at the top which is just a simple asp:textbox. Below that i have a gridview which displays the results of the search. if no search is entered, then the gridview shows all records. Below the gridview i have a formview for inserting and editing the records. when a user clicks on one of the records in the...
0
1488
by: mark.magill | last post by:
Guys using the below code how do I obtain the results from the select query? //======================================================= // Create new SQLDataSource //======================================================= SqlDataSource SQLDataSourceUsersDB = new SqlDataSource(); SQLDataSourceUsersDB.ConnectionString = ConfigurationManager.ConnectionStrings.ToString();
0
9903
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9755
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11048
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7928
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7084
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5954
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4168
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3194
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.