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

datagrid data not showing up

I have a datagrid that simply shows readonly data that i pull using sql.
This was working fine and one day it stopped working.

It shows the headers, but no data. Can anyone point me in the right
direction? I am stuck.
Nov 18 '05 #1
7 1143
run your SQL query in Query Analyser, test that first

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
I have a datagrid that simply shows readonly data that i pull using sql.
This was working fine and one day it stopped working.

It shows the headers, but no data. Can anyone point me in the right
direction? I am stuck.

Nov 18 '05 #2
Sure there is data in your datasource to be shown? Without posting any code
it is going to be very hard to help you.

"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
I have a datagrid that simply shows readonly data that i pull using sql.
This was working fine and one day it stopped working.

It shows the headers, but no data. Can anyone point me in the right
direction? I am stuck.

Nov 18 '05 #3
I have checked this and I have hooked up Profiler to see if my query is
working. Not sure how to check for the data being returned. I assume it is
since I am checking for present data in a Sqldatareader.

Here is my code

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
get_data()

Populate_Fields()

End Sub

Sub get_data()
myConnection = New SqlConnection("x")

myConnection.Open()

myCommand = New SqlCommand("select
BLASTNAME,BFIRSTNAME,BSOCSECNO,loan.LOANNUM,APPLTY PE,LOANSTAT,PROPADDR1 from
borrower, propchar, loan where loan.loanid = borrower.loanid and loan.loanid
= propchar.loanid and borrower.borrowercount = 1 and BSOCSECNO = '" &
Trim(Request.QueryString("SSN")) & "'", myConnection)

myDatareader = myCommand.ExecuteReader()

End Sub

Sub Populate_Fields()

If myDatareader.Read Then

myDataGrid.DataSource = myDatareader

myDataGrid.DataBind()

Else

Label1.Text = "No data found corresponding to an SSN of " &
Request.QueryString("ssn")

End If

myDatareader.Close()

myConnection.Close()

myDatareader = Nothing

myConnection = Nothing

myCommand = Nothing

End Sub

"Michael" <raterus@localhost> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Sure there is data in your datasource to be shown? Without posting any code it is going to be very hard to help you.

"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
I have a datagrid that simply shows readonly data that i pull using sql.
This was working fine and one day it stopped working.

It shows the headers, but no data. Can anyone point me in the right
direction? I am stuck.


Nov 18 '05 #4
Yeah, the query works. I am not sure what else to check. I even ran it
agains Profiler to make sure the query runs.

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
run your SQL query in Query Analyser, test that first

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
I have a datagrid that simply shows readonly data that i pull using sql.
This was working fine and one day it stopped working.

It shows the headers, but no data. Can anyone point me in the right
direction? I am stuck.


Nov 18 '05 #5
it runs, but does it have any data returned?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...
Yeah, the query works. I am not sure what else to check. I even ran it
agains Profiler to make sure the query runs.

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
run your SQL query in Query Analyser, test that first

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
I have a datagrid that simply shows readonly data that i pull using sql. This was working fine and one day it stopped working.

It shows the headers, but no data. Can anyone point me in the right
direction? I am stuck.



Nov 18 '05 #6
yeah, I have taken the query that is generated and ran it in Query Analyzer.
I pulls back data. I have posted my code in a post below.

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2*****************@TK2MSFTNGP12.phx.gbl...
it runs, but does it have any data returned?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...
Yeah, the query works. I am not sure what else to check. I even ran it
agains Profiler to make sure the query runs.

Thanks
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
run your SQL query in Query Analyser, test that first

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
> I have a datagrid that simply shows readonly data that i pull using sql. > This was working fine and one day it stopped working.
>
> It shows the headers, but no data. Can anyone point me in the right
> direction? I am stuck.
>
>



Nov 18 '05 #7
I figured it out. In these cases there was only one record. When I checked
to see if data exists
If mydatareader.read
I was eating up my first record. So when I bound the data, there was none
left. I have to find another way to check for data.
"Brent Burkart" <Br***********@wvmb.com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
I have a datagrid that simply shows readonly data that i pull using sql.
This was working fine and one day it stopped working.

It shows the headers, but no data. Can anyone point me in the right
direction? I am stuck.

Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: irene | last post by:
Hi,I am trying to update a datagrid of a web page but I am having the problems. I am using the sqldataadapter and dataset to bind it to a datagrid. The web page shows a list of people(the datagrid...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
2
by: enak | last post by:
I can not get my datagrid to page. I have a datagrid that I can sort 2 of the columns. This works great. I added paging and when I display the dg it shows 5 pages. (I am showing page numbers at...
2
by: Sky | last post by:
Hello: Another question about trying to wring functionality from a DataGrid... Have a DB table of "Contacts" -- 14 or more fields per record Show in datagrid -- but only 5 columns (First,Last,...
6
by: Dee | last post by:
Hi The paging numbers of my DataGrid dont actually page. What can be the cause? Everyting else seems to work. Thanks Dee
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
4
by: cooltech77 | last post by:
Hi, I am trying to build the following functionality in the datagrid. I have a lot of columns in the datagrid which are being populated from the database and the user needs to scroll...
0
by: cms3023 | last post by:
I have a DataGrid which displays data with the aid of a procedure. I have tested the procedure inside the database and it is working fine. The table inside the database has data that matches with...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.