| | |
Grid and Data not showing up when viewing in browser
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jan 2009
Posts: 4
Reputation:
Solved Threads: 0
I am unable to see the grid or the data. Here is my code from my .aspx file. I don't know what I am doing wrong:
Here is my .aspx.vb (code behind) file:
asp.net Syntax (Toggle Plain Text)
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="resumesearch.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>Resume Search</title> <style type="text/css"> .style1 { font-size: x-large; color: #FF0000; } </style> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" style="font-size: xx-large; font-weight: 700" Text="RESUME SEARCH"></asp:Label> <br /> <br /> <span class="style1">CLICK THE HEADING LINK TO SORT<br /> <br /> <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"> <Columns> <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" /> <asp:BoundField DataField="First Name" HeaderText="First Name" SortExpression="First Name" /> <asp:BoundField DataField="Last Name" HeaderText="Last Name" SortExpression="Last Name" /> <asp:BoundField DataField="Address1" HeaderText="Address1" SortExpression="Address1" /> <asp:BoundField DataField="Address2" HeaderText="Address2" SortExpression="Address2" /> <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" /> <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" /> <asp:BoundField DataField="Zip" HeaderText="Zip" SortExpression="Zip" /> <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" /> <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" /> <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" /> <asp:BoundField DataField="School Name" HeaderText="School Name" SortExpression="School Name" /> <asp:BoundField DataField="College Name" HeaderText="College Name" SortExpression="College Name" /> <asp:BoundField DataField="Years Completed" HeaderText="Years Completed" SortExpression="Years Completed" /> <asp:BoundField DataField="Degree" HeaderText="Degree" SortExpression="Degree" /> <asp:BoundField DataField="Currently Working" HeaderText="Currently Working" SortExpression="Currently Working" /> <asp:BoundField DataField="Job Title" HeaderText="Job Title" SortExpression="Job Title" /> <asp:BoundField DataField="Months at Job" HeaderText="Months at Job" SortExpression="Months at Job" /> <asp:BoundField DataField="Years at Job" HeaderText="Years at Job" SortExpression="Years at Job" /> <asp:BoundField DataField="Job Category" HeaderText="Job Category" SortExpression="Job Category" /> <asp:BoundField DataField="Expected Pay" HeaderText="Expected Pay" SortExpression="Expected Pay" /> <asp:BoundField DataField="Available Start Date" HeaderText="Available Start Date" SortExpression="Available Start Date" /> </Columns> </asp:GridView> </span> </div> </form> </body> </html>
Here is my .aspx.vb (code behind) file:
VisualBasic Syntax (Toggle Plain Text)
Imports System.Collections Imports System.Configuration Imports System.Data Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.HtmlControls Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Data.OleDb Imports System.Data.OleDb.OleDbConnection Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load Dim Panel1 As Panel Dim Panel2 As Panel Dim dtCustomerInfo As Data.DataTable dtCustomerInfo = GetQuery("SELECT * FROM resumetable") GridView1.DataSource = dtCustomerInfo GridView1.DataBind() Panel1.Visible = False Panel2.Visible = True End Sub Private Function GetQuery(strSQL As String) As DataTable Dim dbConn As Data.OleDb.OleDbConnection Dim ExecuteReader as System.Data.OleDb.OleDbConnection Dim cmdSQL As Data.OleDb.OleDbCommand Dim dtResults As Data.DataTable dbConn = (New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\hosting/djbconsulting/access_db/buddyschampion.mdb")) cmdSQL = New Data.OleDb.OleDbCommand(strSQL, dbConn) dbConn.Open() dtResults.Load(cmdSQL.ExecuteReader()) dbConn.Close() Return dtResults End Function End Class
Last edited by peter_budo; Jan 21st, 2009 at 7:50 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Jan 2009
Posts: 4
Reputation:
Solved Threads: 0
Thank you so much for emailing me back!
Yes, there is data in the database - I checked it numerous times. Data is being saved to the database, but I am unable to pull the data back into the grid. Everything works fine on my local machine, but this is being hosted by godaddy. I don't know whats going on and they are unable to help me.
The page is: www.buddyschampion.com/resumesearch.aspx. The text shows up but the grid with the data does not. Please help me!
Thanks!
•
•
Join Date: Jan 2009
Posts: 4
Reputation:
Solved Threads: 0
Yes I did. I have two other forms in which a user fills out a form and then clicks the submit button - the data from the form is then saved to the database. This piece works great. Now, the part that isn't working is when I try to pull the data back froom the database and into a data grid. When viewing it on my browser nothing shows up. Please see www.buddyschampion.com/resumesearch.aspx - you will only see text and no data grid holding the data.
Thanks for your help!
•
•
Join Date: Dec 2008
Posts: 1
Reputation:
Solved Threads: 0
hi ,
i read your code.
so i m help you......
first of all you use asp.net use of microsoft so there is some concept...
in this asp.net you use datasource as below of your gridview control..
select that control
and write this code
and after that pass youe sqldatasourceID to your gridview
and then run your web page
i m sure that using this your data is display.
b'cozin asp.net for the data display datasource is complesary
so try and pls........
reply me with this code.....
i read your code.
so i m help you......
first of all you use asp.net use of microsoft so there is some concept...
in this asp.net you use datasource as below of your gridview control..
select that control
and write this code
ASP.NET Syntax (Toggle Plain Text)
sqldatasource1.connectionString="youe .mdb connectionSrtring" sqldatasource1.selectCommand="your select queare"
and after that pass youe sqldatasourceID to your gridview
gridview1.datasourceId=sqldatasource1.id and then run your web page
i m sure that using this your data is display.
b'cozin asp.net for the data display datasource is complesary
so try and pls........
reply me with this code.....
Last edited by peter_budo; Jan 25th, 2009 at 5:21 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Jan 2009
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
hi ,
i read your code.
so i m help you......
first of all you use asp.net use of microsoft so there is some concept...
in this asp.net you use datasource as below of your gridview control..
select that control
and write this code
ASP.NET Syntax (Toggle Plain Text)
sqldatasource1.connectionString="youe .mdb connectionSrtring" sqldatasource1.selectCommand="your select queare"
and after that pass youe sqldatasourceID to your gridview
gridview1.datasourceId=sqldatasource1.id
and then run your web page
i m sure that using this your data is display.
b'cozin asp.net for the data display datasource is complesary
so try and pls........
reply me with this code.....
OK - so once I add the access connection string in the web.config file, how do I call that connection string from my aspx code behind file?
Thanks!
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: get row index of the selected item !
- Next Thread: GridView Insert Problem
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax alltypeofvideos anathor appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions control countryselector dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash folder form gridview gudi iis image javascript list listbox login maps microsoft mobile mouse mssql nameisnotdeclared news novell numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail richtextbox schoolproject search security select sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visualstudio vs2008 web webapplications webdevelopment webprogramming webservice wizard xsl





