How to display Message when Dataset is Null

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to display Message when Dataset is Null

    I have an asp.net page using a repeater control to display a dataset. When
    the dataset returned is null (no records matched the criteria) I want to
    display a message to the effect "No matching records found". I can't figure
    out how to do this.

    Any help is greatly appreciated,
    Lynnette


    Duppypog Guest

  2. Similar Questions and Discussions

    1. DataSet/DataGrid/Null values
      Strange thing - when I bind a dataset to a datagrid and the dataset column has null values, I cannot edit it. If I try to edit the value, it just...
    2. update row with null numeric or datetime dataset cell values in a datagrid
      I keep getting the, now, dreaded "System.FormatException: String was not recognized as a valid DateTime" error when updating a datagrid row that has...
    3. Remove row with null value from DataSet??
      I'm getting null values in a DataSet which is pulling its data from a web service. The nulls are creating 'System.Data.ConstraintException' in the...
    4. Null values in typed dataset
      Hi! I have a typed dataset which I fill from a select statement, but some columns in my result my be null. When I read this null columns in my...
    5. Return a NULL dataset from a webservice ??!
      When my webservice returns a null dataset my application crashes. null exception error. Has anyone experianced this ? and wondering if anyone has a...
  3. #2

    Default Re: How to display Message when Dataset is Null

    Add a DIV tag as HTMLGeneric with runat set to server. Before you bind to
    the repeater check to see if the dataset is empty. If it is turn on the DIV
    tags display property and turn off the repeater.

    "Duppypog" <duppypog@nospam.com> wrote in message
    news:%23f$8X6OPDHA.3700@tk2msftngp13.phx.gbl...
    > I have an asp.net page using a repeater control to display a dataset.
    When
    > the dataset returned is null (no records matched the criteria) I want to
    > display a message to the effect "No matching records found". I can't
    figure
    > out how to do this.
    >
    > Any help is greatly appreciated,
    > Lynnette
    >
    >

    Jay Pondy Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139