473,770 Members | 5,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET 2.0: GridView, autogeneratecol umns="true" is not working

Hi All,

I am using ASP.NET 2.0 and GridView control.

I have a stored procedure, SP_GetAllRows which takes the table name as
parameter and fires the query "Select * from TableName" dynamically.

My GridView defined like,
<asp:gridview id="CustomersGr idView"
datasourceid="C ustomersSource"
autogeneratecol umns="true"
emptydatatext=" No data available."
allowpaging="tr ue"
runat="server">
In the code behinde file, I set the datasource and call databind.

However, gridview does not display any records even when the stored
procedure returns the rows.
I have verified this through debugger. In fact, when no records are returned
it does display the message, "No data avaialable".

I changed the GridView to DataGrid, but it does not work also.

If I use bound columns and explicitely specify the column name it does work.

However, as store procedure returns the records from different tables at run
time, I am using autogeneratecol umns="true".

What could be wrong?

Why autogeneratecol umns="true" is not working?

Any pointer or help?

TIA
Sachin
Mar 5 '06 #1
0 1448

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

Similar topics

0
3584
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this OleDbParameterCollection" whenI try to write a new record. Delete and Modify work fine its just the add record function causes the error.
0
2674
by: JT | last post by:
This seems like it could be an asp.net bug. I am getting the following exception when I add OnSortCommand attribute to a datagrid. I have deleted the temp directories, rebooted etc and I have isolated it to the OnSortCommands presence. When I use a code behind it doesn't fire any events on the back end and the global error handler grabs it. I put together a very simple example to illustrate the problem below. If anyone has an idea of...
1
12229
by: cyningeston | last post by:
OS: WinXP Pro, VB/ASP/ADO.NET I'm building a web-based supplier management application. For each supplier we are required by the FDA to track certain documents. I've managed to pull them from Access into a Gridview (Gridview1), in which I have AutoGenerateEditButton set to True. What I want is this: when a user clicks "Edit" on a line and it goes to edit mode, I want to grab the supplier's category (4th column of the grid, named...
4
6964
by: Jonathan Wood | last post by:
Okay, I spent about 3 hours getting the GridView control to do what I needed. Basically, I set the control's AutoGenerateColumns to False and then defined a single template column (which I will customize with my own content). This looks something like this: <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" Width="100%" AllowPaging="False"
3
12019
by: Sugandh Jain | last post by:
Hi, I am using property like this.. private DateTime? _propName; public DateTime? PropName { get { return _propName; }
0
8329
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new records there is an error "Incorrect syntax near '-'. Must declare the scalar variable "@UserName". I worked out in design view,code is automatically generated.Iam not able fix the error. Iam working with Visual Web Developer-2005 Express Edition
3
4867
by: nick chan | last post by:
Hi i run into some difficulties getting rowupdating to fire when clicking Update link/button on gridview I set datasource at runtime, basically a datatable Edit and Cancel works. I don't know why RowUpdating just doesn't fire.
0
1983
by: KeesH | last post by:
Hi, I am quite desperate now because I made a nice webshop with a gridview where the customer is able to update the amount of products (Hostas in my situation) or delete the row. The problem is that every works really fine with this code when customers order approximatelly a maximum of 35 products. What I learned so far is to set the EnableViewState="False" for all the labels that don't need a viewstate. This helped a lot. What can I do...
0
1077
by: hhoang.nl | last post by:
I have a very weird problem with the GridView control. Here is the code: <asp:GridView runat="server" ID="gv" AutoGenerateEditButton="true" AutoGenerateSelectButton="true" AllowPaging="true" AutoGenerateColumns="false"> <Columns> <asp:CheckBoxField HeaderText="Enabled" DataField="Enabled"
0
9425
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
10230
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...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7416
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
6678
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
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
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.