How tell if formview has no data?
am 22.10.2007 16:16:37 von CireneUsing code, how can I tell if a formview control has no data/records?
Using code, how can I tell if a formview control has no data/records?
On Oct 22, 4:16 pm, "Cirene"
> 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
Can you provide a sample?
This doesn't seem to work:
If me.fv1.Row Is Nothing Then
"Alexey Smirnov"
news:1193090452.354549.28060@v29g2000prd.googlegroups.com...
> On Oct 22, 4:16 pm, "Cirene"
>> 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
>
On Nov 7, 12:03 am, "Cirene"
> 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
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?
>
>
>