473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to populate gridview asp.net 3.5 with objectdatasource

1
I 'm going to populate a gridview with data from stored procedure in SQL server.
I wrote a method which returns a dataset. than I added an object datasource with all parameters.
onbutton click I bind a gridview

Expand|Select|Wrap|Line Numbers
  1.  protected void button1_Click(object sender, EventArgs e)
  2.         {
  3.         gvLookup.DataBind();
  4.         }
But nothing happened.

would you able to tell me what Im doing wrong?
Expand|Select|Wrap|Line Numbers
  1. <asp:ObjectDataSource ID="AccessDatabase" runat="server" 
  2.             SelectMethod="SearchCheck" TypeName="Cashiering.AccessDatabase">
  3.             <SelectParameters>
  4.                 <asp:ControlParameter ControlID="txtssn" Name="SSN" PropertyName="Text" 
  5.                     Type="String" />
  6.                 <asp:ControlParameter ControlID="txtAmount" Name="nAmount" PropertyName="Text" 
  7.                     Type="String" />
  8.                 <asp:ControlParameter ControlID="txtPlan" Name="sPlan" PropertyName="Text" 
  9.                     Type="String" />
  10.                 <asp:Parameter DefaultValue="0" Name="nMarket" Type="String" />
  11.                 <asp:ControlParameter ControlID="txtParticipant" DefaultValue="" 
  12.                     Name="sParticipant" PropertyName="Text" Type="String" />
  13.                 <asp:ControlParameter ControlID="txtNumber" Name="cNumber" PropertyName="Text" 
  14.                     Type="String" />
  15.                 <asp:ControlParameter ControlID="txtSerNo" Name="sSerNo" PropertyName="Text" 
  16.                     Type="String" />
  17.                 <asp:Parameter DefaultValue="0" Name="dStart" Type="String" />
  18.                 <asp:Parameter DefaultValue="0" Name="dEnd" Type="String" />
  19.             </SelectParameters>
  20.         </asp:ObjectDataSource>
Feb 24 '10 #1
1 2733
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Feb 24 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: A_StClaire_ | last post by:
hi all, I am using a GridView bound to an ObjectDataSource. edit and delete functionality has been enabled. my ObjectDataSource is tied to a TableAdapter that accesses three stored procedures...
0
by: David Hubbard | last post by:
I am using a GridView to display a set of objects that have a parent-child relationship. Each object, MyBO, has an ID property that is used to get the children of that object. class MyBO { ...
1
by: syl | last post by:
Hello I am trying to create a "easy to use" gridview with filters (dropdownlist in headers), sorting...and much more.... In order to do that, i prefer to use a objectdatasource (ODS) beacause...
0
by: jm | last post by:
I have a Gridview with a LinkButton. The button has text from my database. It is not the datakey of the database, just free form text. I want to populate another gridview based upon the data in...
3
by: pblack9455 | last post by:
I have a simple requirement to bind a small ArrayList of (ItemLine) Objects to a GridView control. The Gridview renders on the page and allows me to click update/edit buttons...however the data...
8
by: Greg Lyles | last post by:
Hi all, I'm trying to develop an ASP.NET 2.0 website and am running into some real problems with what I thought would be a relatively simple thing to do. In a nutshell, I'm stuck on trying to...
1
by: Barry L. Camp | last post by:
Hi all, Wondering if someone can help with a nagging problem I am having using a GridView and an ObjectDataSource. I have a simple situation where I am trying to delete a row from a table, but...
5
by: Randy Smith | last post by:
Hi ALL, I wonder if anyone has been using n-tier to bind to a GridView control by using the ObjectDataSource. This is our first OOP web application, and we have no tables. Right now we are...
4
by: Tomasz | last post by:
Hello Developers, Here is interesting problem I just came across: how do I wire a GridView control programmatically? Here is my sample code using Object Data Source: protected void...
4
by: Jonathan Wood | last post by:
Greetings, I have a GridView control. For a couple of reasons, I ended up with a TemplateField to contain my Edit and Delete links, something like this: <asp:TemplateField ShowHeader="False">...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.