displaying user friendly msg, when record is not found

Hi experts,
just a slight problem here.

I have a fully functional datagrid, that searches for data and fills the datagrid with the answer.
However, when there isn't any data i just what to display a  "msg not found" how do i actuall accomplish this.

thanks guys.

see code

      private void btnGo_Click(object sender, System.EventArgs e)
            {
                  //Connection string to the database
                  string connectionString = "server=TTTD.WORLD;User ID=ttt_currency_conversion;Password=ttt_currency_conversion";
                  OracleConnection con = new  OracleConnection(connectionString);
                  //select statement
                  string ora =
                        " SELECT GBP_EXCHANGE_PID, ISO_CODE, DATE_STAMP,  EXCHANGE_RATE " +
                        "  FROM GBP_CURRENCY_RATES  " +
                "  WHERE ISO_CODE LIKE'%"  + this.txtFind.Text.ToUpper() +"%' ";            //used upper for small letter entry
                  
                          //use an adapter in a disconnected enviroment
                  OracleDataAdapter adapter = new OracleDataAdapter(ora, connectionString);
                      //initialise the dataset for the adapter to use
                  DataSet ds = new DataSet();
                  //fill the dataset
                  adapter.Fill(ds);
                  //stop the paging index from miscalculating its position
                  //gets data and binds it to the grid
                  DgExchange.CurrentPageIndex=0;       
                  DgExchange.DataSource=ds;
                  DgExchange.DataBind();
                //close connection
                 con.Close();
                  
                        }

i tried using my old vb.net code but c# does not have the with keyword
   If dv.Count > 0 Then
            With DgRoles
                'stops
                .CurrentPageIndex = 0
                .DataSource = dv
                .DataMember = "Roles"
                .DataKeyField = "Roleid"
                DgRoles.DataBind()
            End With
 Else
                  'If no results, show message in label
            lblError.Text = "No Records Found. Please search again"
        End If

 
SirReadAlotAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cupawntaeCommented:
Try this:

               //fill the dataset
               if (adapter.Fill(ds)>0) {
                   //stop the paging index from miscalculating its position
                   //gets data and binds it to the grid
                   DgExchange.CurrentPageIndex=0;      
                   DgExchange.DataSource=ds;
                   DgExchange.DataBind();
               else {
                   MessageBox.Show("Not found");
               }

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SirReadAlotAuthor Commented:
will try it now, was in a meeting
SirReadAlotAuthor Commented:
thanks mate it works

cheers

SirReadAlot
cupawntaeCommented:
No probs! Thanks for the points! :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.