473,395 Members | 1,401 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,395 software developers and data experts.

loading data to a DataGridView control

Hi,
I am new to Grid view Control.
I have a page with many icons on it for different purposes.
I want to add a Grid View where I want to load data with different columns.
Below is my code(xyz.aspx).Where i need to add the aspx page to my original page.(I tried adding to my HTML page but it returns with an error(We’re sorry, the application is currently unavailable. If you need any assistance, please contact ...)instead of loading data.

I appreciate if any one helps me in this issue

My Code is:
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="xyz.aspx.cs" Inherits="xyz" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.     <div>
  12.  
  13.         LOADING DATA...<br />
  14.         <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
  15.         <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  16.         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
  17.             CellPadding="4" DataKeyNames="NAMEID" DataSourceID="SqlDataSource1" 
  18.             ForeColor="#333333" GridLines="None">
  19.             <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  20.             <RowStyle BackColor="#EFF3FB" />
  21.             <Columns>
  22.                 <asp:BoundField DataField="NAMEID" HeaderText="NAMEID" ReadOnly="True" 
  23.                     SortExpression="NAMEID" />
  24.                 <asp:BoundField DataField="TYPE" HeaderText="TYPE" SortExpression="TYPE" />
  25.                 <asp:BoundField DataField="STATUS" HeaderText="STATUS" 
  26.                     SortExpression="STATUS" />
  27.                 <asp:BoundField DataField="RMPROPID" HeaderText="RMPROPID" 
  28.                     SortExpression="RMPROPID" />
  29.                 <asp:BoundField DataField="BIRTHDAY" HeaderText="BIRTHDAY" 
  30.                     SortExpression="BIRTHDAY" />
  31.                 <asp:BoundField DataField="LASTNAME" HeaderText="LASTNAME" 
  32.                     SortExpression="LASTNAME" />
  33.                 <asp:BoundField DataField="FIRSTNAME" HeaderText="FIRSTNAME" 
  34.                     SortExpression="FIRSTNAME" />
  35.                 <asp:BoundField DataField="MIDINIT" HeaderText="MIDINIT" 
  36.                     SortExpression="MIDINIT" />
  37.                 <asp:BoundField DataField="SSNO" HeaderText="SSNO" SortExpression="SSNO" />
  38.                 <asp:BoundField DataField="LICENSE" HeaderText="LICENSE" 
  39.                     SortExpression="LICENSE" />
  40.                 <asp:BoundField DataField="PHONE" HeaderText="PHONE" SortExpression="PHONE" />
  41.                 <asp:BoundField DataField="COMMENT" HeaderText="COMMENT" 
  42.                     SortExpression="COMMENT" />
  43.                 <asp:BoundField DataField="SEX" HeaderText="SEX" SortExpression="SEX" />
  44.                 <asp:BoundField DataField="WHO" HeaderText="WHO" SortExpression="WHO" />
  45.                 <asp:BoundField DataField="QUALIFY" HeaderText="QUALIFY" 
  46.                     SortExpression="QUALIFY" />
  47.                 <asp:BoundField DataField="PREVRESIDENCE" HeaderText="PREVRESIDENCE" 
  48.                     SortExpression="PREVRESIDENCE" />
  49.                 <asp:BoundField DataField="OCCUPATION" HeaderText="OCCUPATION" 
  50.                     SortExpression="OCCUPATION" />
  51.                 <asp:BoundField DataField="INCOME" HeaderText="INCOME" 
  52.                     SortExpression="INCOME" />
  53.                 <asp:BoundField DataField="GUARANTOR" HeaderText="GUARANTOR" 
  54.                     SortExpression="GUARANTOR" />
  55.                 <asp:BoundField DataField="LOCATION" HeaderText="LOCATION" 
  56.                     SortExpression="LOCATION" />
  57.                 <asp:BoundField DataField="MRKTID" HeaderText="MRKTID" 
  58.                     SortExpression="MRKTID" />
  59.                 <asp:BoundField DataField="LEASAGID" HeaderText="LEASAGID" 
  60.                     SortExpression="LEASAGID" />
  61.                 <asp:BoundField DataField="COMPANY" HeaderText="COMPANY" 
  62.                     SortExpression="COMPANY" />
  63.                 <asp:BoundField DataField="JOBTITLE" HeaderText="JOBTITLE" 
  64.                     SortExpression="JOBTITLE" />
  65.                 <asp:BoundField DataField="JOBYRS" HeaderText="JOBYRS" 
  66.                     SortExpression="JOBYRS" />
  67.                 <asp:BoundField DataField="NONSF" HeaderText="NONSF" SortExpression="NONSF" />
  68.                 <asp:BoundField DataField="NOLATE" HeaderText="NOLATE" 
  69.                     SortExpression="NOLATE" />
  70.                 <asp:BoundField DataField="PAYALLOWED" HeaderText="PAYALLOWED" 
  71.                     SortExpression="PAYALLOWED" />
  72.                 <asp:BoundField DataField="LASTDATE" HeaderText="LASTDATE" 
  73.                     SortExpression="LASTDATE" />
  74.                 <asp:BoundField DataField="USERID" HeaderText="USERID" 
  75.                     SortExpression="USERID" />
  76.                 <asp:BoundField DataField="NAMEGROUP" HeaderText="NAMEGROUP" 
  77.                     SortExpression="NAMEGROUP" />
  78.                 <asp:BoundField DataField="RESPROPID" HeaderText="RESPROPID" 
  79.                     SortExpression="RESPROPID" />
  80.                 <asp:BoundField DataField="RMBLDGID" HeaderText="RMBLDGID" 
  81.                     SortExpression="RMBLDGID" />
  82.                 <asp:BoundField DataField="UNITID" HeaderText="UNITID" 
  83.                     SortExpression="UNITID" />
  84.                 <asp:BoundField DataField="RMLEASE" HeaderText="RMLEASE" 
  85.                     SortExpression="RMLEASE" />
  86.                 <asp:BoundField DataField="SH" HeaderText="SH" SortExpression="SH" />
  87.                 <asp:BoundField DataField="SHWLDATE" HeaderText="SHWLDATE" 
  88.                     SortExpression="SHWLDATE" />
  89.                 <asp:BoundField DataField="SHWLSEQNO" HeaderText="SHWLSEQNO" 
  90.                     SortExpression="SHWLSEQNO" />
  91.                 <asp:BoundField DataField="MARRIED" HeaderText="MARRIED" 
  92.                     SortExpression="MARRIED" />
  93.                 <asp:BoundField DataField="PREVNAMEID" HeaderText="PREVNAMEID" 
  94.                     SortExpression="PREVNAMEID" />
  95.                 <asp:BoundField DataField="USIZE" HeaderText="USIZE" SortExpression="USIZE" />
  96.                 <asp:BoundField DataField="BANKACCT" HeaderText="BANKACCT" 
  97.                     SortExpression="BANKACCT" />
  98.                 <asp:BoundField DataField="QUERY" HeaderText="QUERY" SortExpression="QUERY" />
  99.                 <asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" />
  100.                 <asp:BoundField DataField="CREDITSTATUS" HeaderText="CREDITSTATUS" 
  101.                     SortExpression="CREDITSTATUS" />
  102.                 <asp:BoundField DataField="RCTENANDID" HeaderText="RCTENANDID" 
  103.                     SortExpression="RCTENANDID" />
  104.                 <asp:BoundField DataField="RCTENANTID" HeaderText="RCTENANTID" 
  105.                     SortExpression="RCTENANTID" />
  106.                 <asp:BoundField DataField="PASSTID" HeaderText="PASSTID" 
  107.                     SortExpression="PASSTID" />
  108.                 <asp:BoundField DataField="OCCUPYDATE" HeaderText="OCCUPYDATE" 
  109.                     SortExpression="OCCUPYDATE" />
  110.                 <asp:BoundField DataField="VACATEDATE" HeaderText="VACATEDATE" 
  111.                     SortExpression="VACATEDATE" />
  112.                 <asp:BoundField DataField="WORKPHONE1" HeaderText="WORKPHONE1" 
  113.                     SortExpression="WORKPHONE1" />
  114.                 <asp:BoundField DataField="WORKPHONE2" HeaderText="WORKPHONE2" 
  115.                     SortExpression="WORKPHONE2" />
  116.                 <asp:BoundField DataField="CELL" HeaderText="CELL" SortExpression="CELL" />
  117.                 <asp:BoundField DataField="FAX" HeaderText="FAX" SortExpression="FAX" />
  118.                 <asp:BoundField DataField="TABID" HeaderText="TABID" SortExpression="TABID" />
  119.                 <asp:BoundField DataField="MVIREASN" HeaderText="MVIREASN" 
  120.                     SortExpression="MVIREASN" />
  121.                 <asp:BoundField DataField="NMBRRESIDENTS" HeaderText="NMBRRESIDENTS" 
  122.                     SortExpression="NMBRRESIDENTS" />
  123.                 <asp:BoundField DataField="NOSSNO" HeaderText="NOSSNO" 
  124.                     SortExpression="NOSSNO" />
  125.                 <asp:BoundField DataField="BACKGRNDSTATUS" HeaderText="BACKGRNDSTATUS" 
  126.                     SortExpression="BACKGRNDSTATUS" />
  127.                 <asp:BoundField DataField="OTRESBCKGRNDREQ" HeaderText="OTRESBCKGRNDREQ" 
  128.                     SortExpression="OTRESBCKGRNDREQ" />
  129.                 <asp:BoundField DataField="BCKGRNDFLUP" HeaderText="BCKGRNDFLUP" 
  130.                     SortExpression="BCKGRNDFLUP" />
  131.                 <asp:BoundField DataField="WEBNOCHECKS" HeaderText="WEBNOCHECKS" 
  132.                     SortExpression="WEBNOCHECKS" />
  133.                 <asp:BoundField DataField="OCCINACTIVE" HeaderText="OCCINACTIVE" 
  134.                     SortExpression="OCCINACTIVE" />
  135.                 <asp:BoundField DataField="LIHTC" HeaderText="LIHTC" SortExpression="LIHTC" />
  136.                 <asp:BoundField DataField="TCCERTIFIED" HeaderText="TCCERTIFIED" 
  137.                     SortExpression="TCCERTIFIED" />
  138.                 <asp:BoundField DataField="AUTOSPREAD" HeaderText="AUTOSPREAD" 
  139.                     SortExpression="AUTOSPREAD" />
  140.                 <asp:BoundField DataField="EMAILSENT" HeaderText="EMAILSENT" 
  141.                     SortExpression="EMAILSENT" />
  142.                 <asp:BoundField DataField="CHKOPTOUT" HeaderText="CHKOPTOUT" 
  143.                     SortExpression="CHKOPTOUT" />
  144.                 <asp:BoundField DataField="EXCLUDENWP" HeaderText="EXCLUDENWP" 
  145.                     SortExpression="EXCLUDENWP" />
  146.                 <asp:BoundField DataField="NWPDATE" HeaderText="NWPDATE" 
  147.                     SortExpression="NWPDATE" />
  148.                 <asp:BoundField DataField="CALLCENTERENTRY" HeaderText="CALLCENTERENTRY" 
  149.                     SortExpression="CALLCENTERENTRY" />
  150.                 <asp:BoundField DataField="RLEASETYPE" HeaderText="RLEASETYPE" 
  151.                     SortExpression="RLEASETYPE" />
  152.                 <asp:BoundField DataField="RNTINCR" HeaderText="RNTINCR" 
  153.                     SortExpression="RNTINCR" />
  154.                 <asp:BoundField DataField="ARRESTEDPENDINGTRIAL" 
  155.                     HeaderText="ARRESTEDPENDINGTRIAL" SortExpression="ARRESTEDPENDINGTRIAL" />
  156.                 <asp:BoundField DataField="caBrokenLease" HeaderText="caBrokenLease" 
  157.                     SortExpression="caBrokenLease" />
  158.                 <asp:BoundField DataField="caControlledSubstance" 
  159.                     HeaderText="caControlledSubstance" SortExpression="caControlledSubstance" />
  160.                 <asp:BoundField DataField="caConvictedPersons" HeaderText="caConvictedPersons" 
  161.                     SortExpression="caConvictedPersons" />
  162.                 <asp:BoundField DataField="caConvictedProperty" 
  163.                     HeaderText="caConvictedProperty" SortExpression="caConvictedProperty" />
  164.                 <asp:BoundField DataField="caEvicted" HeaderText="caEvicted" 
  165.                     SortExpression="caEvicted" />
  166.                 <asp:BoundField DataField="caSued" HeaderText="caSued" 
  167.                     SortExpression="caSued" />
  168.                 <asp:BoundField DataField="CONVICTEDFELONY" HeaderText="CONVICTEDFELONY" 
  169.                     SortExpression="CONVICTEDFELONY" />
  170.                 <asp:BoundField DataField="LICENSESTATE" HeaderText="LICENSESTATE" 
  171.                     SortExpression="LICENSESTATE" />
  172.                 <asp:BoundField DataField="OCCUPANT" HeaderText="OCCUPANT" 
  173.                     SortExpression="OCCUPANT" />
  174.             </Columns>
  175.             <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
  176.             <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  177.             <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  178.             <EditRowStyle BackColor="#2461BF" />
  179.             <AlternatingRowStyle BackColor="White" />
  180.         </asp:GridView>
  181.  
  182.     </div>
  183.     <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
  184.         ConnectionString="<%$ ConnectionStrings:BasemriConnectionString %>" 
  185.         SelectCommand="SELECT * FROM [NAME] WHERE ([email] = @EMAILID)">
  186.         <SelectParameters>
  187.             <asp:QueryStringParameter Name="EMAILID" QueryStringField="EMAILID" 
  188.                 Type="String" />
  189.         </SelectParameters>
  190.     </asp:SqlDataSource>
  191.     </form>
  192. </body>
  193. </html>
Thanks in advance'
T
Aug 31 '08 #1
0 1229

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

Similar topics

5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
6
by: dbuchanan | last post by:
Hello, Is this a bug? Is there some kind of work around? I want to add default values for a few columns in my datagridview I found the "DefaultValuesNeeded" event for the datagridview I...
0
by: RSH | last post by:
I have a simple Windows Form, where i have a datagridview. The user can switch between databases and select the tables via DropDownLists. I am having a problem that I can't really pinpoint when...
1
by: Luca Beretta | last post by:
I think this a simple question but i'm breaking my brain without results. I've a datagridview bounded to a datatable, with an imagecolumn that should contain a different bitmap depending from a...
2
by: Rick Shaw | last post by:
Hi, I have a problem with the datagridview not refreshed when the application first appear on the screen. The datagridview display data from a table in the dataset. At the same time, I've added...
0
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by...
1
by: Jeff | last post by:
Hey ..NET 2.0 I've created a User Control which contain a DataGridView. This User Control is displayed on a TabPage. This TabPage is added to the TabControl during runtime. The problem is...
0
by: jchaturv | last post by:
All, I have a customized DataGridView where I have implemented extra functionality and bounded datasource in the same custom DataGridView (Using C# and .NET). Now, I could able to use it...
4
by: alex21 | last post by:
Ok im getting this exception from a DataGridView control in my program. System.ArgumentOutOfRangeException was unhandled Message="Value of '132' is not valid for 'Value'. 'Value' should be...
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:
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...
0
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,...
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.