NO_DATA Error

  • Thread starter Thread starter Viji Krish
  • Start date Start date
V

Viji Krish

Hi,

The sql returns value since i select primary key (cannot be null), but when
i try to bind with combo box i get following error.. i cant see data. Iam
using ODBC connection from asp.net to talk to DB2 database. Any help gurus

System.Data.Odbc.OdbcException: NO_DATA - no error information available

Thanks,
Krish
 
What are you binding to - a DataTable, DataView or are you using
ExecuteScalar? - However any of these scenarios are doubtful - are you 100%
that you are returning a value that exists, and that the paramaters are
correct and all that jazz?
 
I using DataReader. I wrote query to return value primary key and so iam
sure they dont return null values.

here is the code.
OdbcDataReader ddDR2 = null;
OdbcConnection cn = new OdbcConnection("DSN=myDSN");
OdbcCommand ddSqlCommand2 = new OdbcCommand ("SELECT cd_district FROM
depdb.km_zip_district", cn);
cn.Open();
ddDR2 = ddSqlCommand2.ExecuteReader(CommandBehavior.CloseConnection);
cboMajor.DataSource = ddDR2;
cboMajor.DataTextField = "cd_district ";
cboMajor.DataValueField = "cd_district ";
cboMajor.DataBind();
ddDR2.Close();
 
Back
Top