Solved

Datagrid problem

Posted on 2006-11-08
5
241 Views
Last Modified: 2010-04-23
I am running the procedure below on my vb.net page when ever the datagrid is clicked.  it is picking up the correct screenid number but when the page is viewed if the dataset has no records in it the datagrid remains keeps the same records.  Can someone tell me how to get it to switch to no records if none are returned.

Thanks

   SqlDataAdapter6.SelectCommand.Parameters("@paramid").Value = screenid
     SqlDataAdapter6.Fill(DsPAScreen61, "tblPAPhoneVoucher")
        DataGrid1.DataSource = (DsPAScreen61)
        DataGrid1.DataMember = "tblPAPhoneVoucher"
0
Comment
Question by:running32
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:Xeavn
ID: 17900147
Try using

DataGrid1.DataBind()

after setting the DataSource.
0
 

Author Comment

by:running32
ID: 17900214
It tells me datagrid is not a member of form.datagrid
0
 
LVL 13

Accepted Solution

by:
newyuppie earned 500 total points
ID: 17900240
maybe the dataset is not getting cleared before the fill. try one of 2 options

1) set the ClearBeforeFill property to TRUE for the dataset

or

2)
try adding
DsPAScreen61.Clear()
before filling the dataadapter
0
 

Author Comment

by:running32
ID: 17900284
That's it thanks
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17900321
your welcome.
thanks for the grade
NY
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

860 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