Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 4th, 2007, 05:33 PM
Authorized User
Points: 395, Level: 6
Points: 395, Level: 6 Points: 395, Level: 6 Points: 395, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2007
Location: London, , United Kingdom.
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
Default usin g stored procedure with parameter


i am trying to call a stored procedure that contain one parameter (CIty). But for some reason it doesn't display any records ..(i tried the same query in SQL Server Management studio and got the decired record ...so i must be doing something wrong... On the page i have created a textbox and actually thatswhere user enter the city name: the code is given bellow:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CheckingStoreProcedure.aspx.vb" Inherits="GridView_Checking.CheckingStoreProcedure " %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>


<form id="form1" runat="server">


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>"

SelectCommand="ViewSelectedRecord" SelectCommandType="StoredProcedure">

<selectParameters >

<asp:ControlParameter Name ="City" ControlID ="TextBox1" Type=String PropertyName= "text"/>



<asp:TextBox ID="TextBox1" runat="server" Style="left: 11px; position: relative;
top: -2px"></asp:TextBox>

<asp:Button ID="Button1" runat="server" Style="left: 60px; position: relative; top: -1px"

Text="Button" />

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"

DataKeyNames="StudentID" DataMember="DefaultView" DataSourceID="SqlDataSource1"

ForeColor="#333333" GridLines="None" Style="position: relative">

<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />


<asp:BoundField DataField="StudentID" HeaderText="StudentID" ReadOnly="True" SortExpression="StudentID" />

<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />

<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />

<asp:BoundField DataField="Course" HeaderText="Course" SortExpression="Course" />

<asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />

<asp:BoundField DataField="YearOfGraduation" HeaderText="YearOfGraduation" SortExpression="YearOfGraduation" />

<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />


<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />

<EditRowStyle BackColor="#999999" />

<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />

<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />

<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<AlternatingRowStyle BackColor="White" ForeColor="#284775" />





Reply With Quote
  #2 (permalink)  
Old September 5th, 2007, 12:27 AM
Friend of Wrox
Join Date: Aug 2006
Location: Amman, , Jordan.
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts

man post the procedure

Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass XML parameter to stored procedure BCullenward Classic ASP Databases 3 September 10th, 2008 02:07 PM
Query Parameter of a Stored Procedure tarang SQL Server 2000 4 July 25th, 2007 11:43 AM
How to pass a parameter to a stored procedure? MaxGay2 VB.NET 2002/2003 Basics 1 November 8th, 2006 02:48 PM
Passing a parameter value to Stored Procedure mcinar SQL Server 2000 9 October 3rd, 2004 09:42 PM
Pass an Array as a Parameter to a Stored Procedure booksnore2 Oracle 0 August 31st, 2004 09:20 AM

All times are GMT -4. The time now is 12:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.