How tell if formview has no data?

How tell if formview has no data?

am 22.10.2007 16:16:37 von Cirene

Using code, how can I tell if a formview control has no data/records?

Re: How tell if formview has no data?

am 23.10.2007 00:00:52 von lexa

On Oct 22, 4:16 pm, "Cirene" wrote:
> 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

Re: How tell if formview has no data?

am 07.11.2007 00:03:16 von Inamori Izumi

Can you provide a sample?

This doesn't seem to work:

If me.fv1.Row Is Nothing Then

"Alexey Smirnov" wrote in message
news:1193090452.354549.28060@v29g2000prd.googlegroups.com...
> On Oct 22, 4:16 pm, "Cirene" wrote:
>> 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
>

Re: How tell if formview has no data?

am 07.11.2007 20:26:06 von lexa

On Nov 7, 12:03 am, "Cirene" wrote:
> 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/library/system.web.ui.webco ntrols.formview.dataitemcount.aspx

RE: How tell if formview has no data?

am 28.01.2008 21:53:01 von Geo

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?
>
>
>