473,399 Members | 2,159 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,399 software developers and data experts.

How tell if formview has no data?

Using code, how can I tell if a formview control has no data/records?
Oct 22 '07 #1
4 6499
On Oct 22, 4:16 pm, "Cirene" <invalid_em...@zzz.comwrote:
Using code, how can I tell if a formview control has no data/records?
I think there are few ways you can do it, you can check if
Formview.DataItem, or Formview.Row are not null, you can check if
datasource has rows, etc

Oct 22 '07 #2
Can you provide a sample?

This doesn't seem to work:

If me.fv1.Row Is Nothing Then

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@v29g2000prd.googlegro ups.com...
On Oct 22, 4:16 pm, "Cirene" <invalid_em...@zzz.comwrote:
>Using code, how can I tell if a formview control has no data/records?

I think there are few ways you can do it, you can check if
Formview.DataItem, or Formview.Row are not null, you can check if
datasource has rows, etc

Nov 6 '07 #3
On Nov 7, 12:03 am, "Cirene" <t...@test.comwrote:
Can you provide a sample?

This doesn't seem to work:

If me.fv1.Row Is Nothing Then
Hi Cirene,

did you check the DataItemCount Property? It seems that it would help
you...

If fv1.DataItemCount = 0 Then
....

http://msdn2.microsoft.com/en-us/lib...itemcount.aspx

Nov 7 '07 #4
Hi, Why dont you try..
for (int i = 0; i <= [FormviewName].PageCount; i++)
{
//Will come here if there is data.
}

"Cirene" wrote:
Using code, how can I tell if a formview control has no data/records?
Jan 28 '08 #5

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

Similar topics

8
by: Ottar | last post by:
I have a few numeric fields, and when I update i get the error: "Input string was not in a correct format". Next line:" System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&...
1
by: TdarTdar | last post by:
I wanted to add three columns up on the form and run some logic to fill in the third but not sure how to call the field names in the formview control. Dim Girth As Integer Elenght =...
1
by: sck10 | last post by:
Hello, I am pulling data from a SQL Server table. One field that is (varchar 4000) is used to show notes. I am using a FormView for showing and editing the data. When the form is in Item...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
2
by: P. Yanzick | last post by:
Hello, I am creating an edit template for a FormView control, changing one of the textboxes to a dropdown box. The dropdown will be populated from a simple table with the primary key, and a...
3
by: Jurgen Appelo | last post by:
I asked this question earlier, but unfortunately the two replies I got did not solve the problem. Here it is again, but now with the code: After an Update my FormView always loses its viewstate...
2
by: rodchar | last post by:
hey all, i'm trying to bind my dataset to a formview but i get a message that says: Conversion from type 'DBNull' to type 'Boolean' is not valid. in order to fix this do i have to specify false...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
5
by: =?Utf-8?B?QWRhciBXZXNsZXk=?= | last post by:
Hi All, I have a GridView inside the EditItemTemplate of a FormView. Both FormView and GridView are data bound using an ObjectDataSource. When the FormView's ObjectDataSource object has a...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.