Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > Visual Web Developer 2005
|
Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Web Developer 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2007, 08:30 PM
Registered User
 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to crosales
Default Passing parameters from one page to another

Hi,
I am new to VWD and don't have much experience with it. I am trying to create a page that displays a gridview. The grid object obtain data from a query to a table in VisualFoxpro accesed via ODBC. The query was created with the "Configure Data Source" wizard of the object and includes a WHERE statement with a parameter obtained from the http string. I have tried many ways but it just doesn't seem to work, always returns a "blank" page when previewed. I checked the url string and it does have the correct parameter name and value. Anybody could please help me find out what is wrong or have an alternate solution to passing parameters from one page to another ??? Below is the code for the gridview page. Thanks a lot.

<%@ Page Language="VB" %>

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

<script runat="server">

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim cual_invent As Integer = Page.Request.QueryString("InventID")
    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Detalle de Inventario</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;
        <br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2">
            <Columns>
                <asp:BoundField DataField="inventario" HeaderText="inventario" SortExpression="inventario" />
                <asp:BoundField DataField="orden" HeaderText="orden" SortExpression="orden" />
                <asp:BoundField DataField="partno" HeaderText="partno" SortExpression="partno" />
                <asp:BoundField DataField="descrip" HeaderText="descrip" SortExpression="descrip" />
                <asp:BoundField DataField="umedida" HeaderText="umedida" SortExpression="umedida" />
                <asp:BoundField DataField="cantidad" HeaderText="cantidad" SortExpression="cantidad" />
                <asp:BoundField DataField="peso" HeaderText="peso" SortExpression="peso" />
                <asp:BoundField DataField="porder" HeaderText="porder" SortExpression="porder" />
                <asp:BoundField DataField="location" HeaderText="location" SortExpression="location" />
                <asp:BoundField DataField="saldo" HeaderText="saldo" SortExpression="saldo" />
                <asp:BoundField DataField="origen" HeaderText="origen" SortExpression="origen" />
                <asp:BoundField DataField="marca" HeaderText="marca" SortExpression="marca" />
                <asp:BoundField DataField="modelo" HeaderText="modelo" SortExpression="modelo" />
                <asp:BoundField DataField="serie" HeaderText="serie" SortExpression="serie" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Trafico_Conctn %>"
            ProviderName="<%$ ConnectionStrings:Trafico_Conctn.ProviderName %>" SelectCommand="SELECT * FROM [inv_detail] WHERE ([descrip] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="descrip" QueryStringField="InventID" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        &nbsp;<br />
        <br />

    </div>
    </form>
</body>
</html>


 
Old November 30th, 2007, 08:47 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Maybe descrip doesn't contain what you think it does in the database? Maybe this field is actually padded with spaces?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameters fizzerchris Access VBA 5 August 31st, 2007 12:16 PM
Passing parameters tal Ajax 5 May 26th, 2007 08:07 AM
Passing parameters to a new page... gbianchi ASP.NET 1.0 and 1.1 Basics 1 March 8th, 2006 03:02 PM
Passing parameters ceema Crystal Reports 0 February 15th, 2006 04:03 AM
passing parameters spraveens Javascript How-To 1 October 8th, 2003 03:14 AM





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