Grid and Data not showing up when viewing in browser

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2009
Posts: 4
Reputation: devirell is an unknown quantity at this point 
Solved Threads: 0
devirell devirell is offline Offline
Newbie Poster

Grid and Data not showing up when viewing in browser

 
0
  #1
Jan 20th, 2009
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:



  1. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="resumesearch.aspx.vb" Inherits="_Default" %>
  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>Resume Search</title>
  8. <style type="text/css">
  9. .style1
  10. {
  11. font-size: x-large;
  12. color: #FF0000;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <form id="form1" runat="server">
  18. <div>
  19.  
  20. <asp:Label ID="Label1" runat="server"
  21. style="font-size: xx-large; font-weight: 700"
  22. Text="RESUME SEARCH"></asp:Label>
  23. <br />
  24. <br />
  25. <span class="style1">CLICK THE HEADING LINK TO SORT<br />
  26. <br />
  27.  
  28. <asp:GridView ID="GridView1" runat="server" AllowSorting="True"
  29. AutoGenerateColumns="False">
  30. <Columns>
  31. <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
  32. <asp:BoundField DataField="First Name" HeaderText="First Name"
  33. SortExpression="First Name" />
  34. <asp:BoundField DataField="Last Name" HeaderText="Last Name"
  35. SortExpression="Last Name" />
  36. <asp:BoundField DataField="Address1" HeaderText="Address1"
  37. SortExpression="Address1" />
  38. <asp:BoundField DataField="Address2" HeaderText="Address2"
  39. SortExpression="Address2" />
  40. <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
  41. <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />
  42. <asp:BoundField DataField="Zip" HeaderText="Zip" SortExpression="Zip" />
  43. <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
  44. <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
  45. <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
  46. <asp:BoundField DataField="School Name" HeaderText="School Name"
  47. SortExpression="School Name" />
  48. <asp:BoundField DataField="College Name" HeaderText="College Name"
  49. SortExpression="College Name" />
  50. <asp:BoundField DataField="Years Completed" HeaderText="Years Completed"
  51. SortExpression="Years Completed" />
  52. <asp:BoundField DataField="Degree" HeaderText="Degree"
  53. SortExpression="Degree" />
  54. <asp:BoundField DataField="Currently Working" HeaderText="Currently Working"
  55. SortExpression="Currently Working" />
  56. <asp:BoundField DataField="Job Title" HeaderText="Job Title"
  57. SortExpression="Job Title" />
  58. <asp:BoundField DataField="Months at Job" HeaderText="Months at Job"
  59. SortExpression="Months at Job" />
  60. <asp:BoundField DataField="Years at Job" HeaderText="Years at Job"
  61. SortExpression="Years at Job" />
  62. <asp:BoundField DataField="Job Category" HeaderText="Job Category"
  63. SortExpression="Job Category" />
  64. <asp:BoundField DataField="Expected Pay" HeaderText="Expected Pay"
  65. SortExpression="Expected Pay" />
  66. <asp:BoundField DataField="Available Start Date"
  67. HeaderText="Available Start Date" SortExpression="Available Start Date" />
  68. </Columns>
  69. </asp:GridView>
  70. </span>
  71.  
  72. </div>
  73. </form>
  74. </body>
  75. </html>




Here is my .aspx.vb (code behind) file:


VisualBasic Syntax (Toggle Plain Text)
  1. Imports System.Collections
  2. Imports System.Configuration
  3. Imports System.Data
  4. Imports System.Web
  5. Imports System.Web.Security
  6. Imports System.Web.UI
  7. Imports System.Web.UI.HtmlControls
  8. Imports System.Web.UI.WebControls
  9. Imports System.Web.UI.WebControls.WebParts
  10. Imports System.Data.OleDb
  11. Imports System.Data.OleDb.OleDbConnection
  12.  
  13.  
  14. Partial Class _Default
  15. Inherits System.Web.UI.Page
  16.  
  17.  
  18. Protected Sub Page_Load
  19.  
  20. Dim Panel1 As Panel
  21. Dim Panel2 As Panel
  22.  
  23.  
  24. Dim dtCustomerInfo As Data.DataTable
  25.  
  26. dtCustomerInfo = GetQuery("SELECT * FROM resumetable")
  27.  
  28.  
  29. GridView1.DataSource = dtCustomerInfo
  30. GridView1.DataBind()
  31.  
  32. Panel1.Visible = False
  33. Panel2.Visible = True
  34. End Sub
  35.  
  36. Private Function GetQuery(strSQL As String) As DataTable
  37. Dim dbConn As Data.OleDb.OleDbConnection
  38. Dim ExecuteReader as System.Data.OleDb.OleDbConnection
  39. Dim cmdSQL As Data.OleDb.OleDbCommand
  40. Dim dtResults As Data.DataTable
  41.  
  42. dbConn = (New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\hosting/djbconsulting/access_db/buddyschampion.mdb"))
  43.  
  44. cmdSQL = New Data.OleDb.OleDbCommand(strSQL, dbConn)
  45.  
  46. dbConn.Open()
  47. dtResults.Load(cmdSQL.ExecuteReader())
  48. dbConn.Close()
  49.  
  50. Return dtResults
  51. End Function
  52. 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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 41
Reputation: julseypart is an unknown quantity at this point 
Solved Threads: 0
julseypart julseypart is offline Offline
Light Poster

Re: Grid and Data not showing up when viewing in browser

 
0
  #2
Jan 21st, 2009
is there data in the database?
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: devirell is an unknown quantity at this point 
Solved Threads: 0
devirell devirell is offline Offline
Newbie Poster

Re: Grid and Data not showing up when viewing in browser

 
0
  #3
Jan 21st, 2009
Originally Posted by julseypart View Post
is there data in the database?

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!
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Grid and Data not showing up when viewing in browser

 
0
  #4
Jan 22nd, 2009
did u place "buddyschampion.mdb" in site
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: devirell is an unknown quantity at this point 
Solved Threads: 0
devirell devirell is offline Offline
Newbie Poster

Re: Grid and Data not showing up when viewing in browser

 
0
  #5
Jan 22nd, 2009
Originally Posted by greeny_1984 View Post
did u place "buddyschampion.mdb" in site

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!
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 1
Reputation: nikhilddu is an unknown quantity at this point 
Solved Threads: 0
nikhilddu nikhilddu is offline Offline
Newbie Poster

Re: Grid and Data not showing up when viewing in browser

 
0
  #6
Jan 23rd, 2009
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


  1. sqldatasource1.connectionString="youe .mdb connectionSrtring"
  2. 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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Grid and Data not showing up when viewing in browser

 
0
  #7
Jan 23rd, 2009
hi,

did u give read and write permissions for the database in the site.
call u r site hosting agent and ask him to give permissions.
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: devirell is an unknown quantity at this point 
Solved Threads: 0
devirell devirell is offline Offline
Newbie Poster

Re: Grid and Data not showing up when viewing in browser

 
0
  #8
Jan 25th, 2009
Originally Posted by nikhilddu View Post
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


  1. sqldatasource1.connectionString="youe .mdb connectionSrtring"
  2. 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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC