English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How I can know my sqldatasourse found any record or not I dont want to use datalist or another data table .and how I can put each feild that sqldatasource found on a string object( ineed just one record that sqldatasource found.)
I need a code that on page load automaticly goto another page

2006-07-31 05:47:31 · 2 answers · asked by margemoosh 3 in Computers & Internet Programming & Design

2 answers

first you have to make a datareader (let's call it rd1 for example), and fill it with proper data from the datasource.

now you use

while ( rd1.read())
{
// do what ever and then go the next record in rd1
}

the secret is that the method rd1.read() will check if there are any records retrieved, and if yes it will return them

2006-07-31 06:33:39 · answer #1 · answered by wisam z 3 · 3 1

The DataTable has a property called Rows, which has a property called Count. Obvoiusly, if Count == 0, then no rows were return.
Simple as that.

2006-07-31 14:08:12 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers