Solved

gridview doesn't display data part 2 (with code behind)

Posted on 2008-10-28
1
252 Views
Last Modified: 2010-04-14
I am working in Visual Studio 2005, and ive built a data connection with a gridview (i also tried formview) bound to a table called test. the connection tests fine, everything looks fine, but when i 'run' the page, nothing displays. I'm new at asp.net, so this is probably quite simple, but i cannot seem to find reference to it anywhere. ive tried the things ive found in books and on the web, to no avail. help? thanks in advance.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
 
<!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>TEST</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True"
            Caption="Name Table" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False">
            <AlternatingRowStyle BackColor="#FF8080" Font-Names="Times New Roman" Font-Size="Medium"
                ForeColor="Black" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
            ConnectionString="<%$ ConnectionStrings:testConnectionString2 %>" DeleteCommand="DELETE FROM [Name] WHERE [ID] = @original_ID AND [FName] = @original_FName AND [LName] = @original_LName"
            InsertCommand="INSERT INTO [Name] ([FName], [LName], [ID]) VALUES (@FName, @LName, @ID)"
            OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Name]"
            UpdateCommand="UPDATE [Name] SET [FName] = @FName, [LName] = @LName WHERE [ID] = @original_ID AND [FName] = @original_FName AND [LName] = @original_LName" EnableCaching="True">
            <DeleteParameters>
                <asp:Parameter Name="original_ID" Type="Int32" />
                <asp:Parameter Name="original_FName" Type="String" />
                <asp:Parameter Name="original_LName" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="FName" Type="String" />
                <asp:Parameter Name="LName" Type="String" />
                <asp:Parameter Name="original_ID" Type="Int32" />
                <asp:Parameter Name="original_FName" Type="String" />
                <asp:Parameter Name="original_LName" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="FName" Type="String" />
                <asp:Parameter Name="LName" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1">
        </asp:FormView>
    
    </div>
    </form>
   
</body>
</html>

Open in new window

0
Comment
Question by:cmajor118
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
cmajor118 earned 0 total points
ID: 22822504
i figured it out. in the properties, under Misc, go to columns and add those i wish to view. what a noob! lol. thanks tho!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question