Dataview returns 0 rows

  • Thread starter Andy Sutorius via DotNetMonster.com
  • Start date
A

Andy Sutorius via DotNetMonster.com

Hi,

My dataview is returning 0 rows however I know there are rows in the
dataset with the matching data. Do you see anything wrong with my code. Can
you suggest a way to debug?

Thanks,

Andy

public DataView BindCodeDropDown()
{
SqlConnection oConn = new SqlConnection(DBConnectionString);
SqlDataAdapter dadCode = new SqlDataAdapter("sp_web_835_ddl_code",oConn)
;
DataSet dstCode = new DataSet();
dadCode.Fill(dstCode,"CodeTable");
// return dstCode;

DataView CodeView = new DataView(dstCode.Tables["CodeTables"]);
CodeView.RowFilter="type='F'";
return CodeView;
}
 
C

Curt_C [MVP]

Andy said:
Hi,

My dataview is returning 0 rows however I know there are rows in the
dataset with the matching data. Do you see anything wrong with my code. Can
you suggest a way to debug?

Thanks,

Andy

public DataView BindCodeDropDown()
{
SqlConnection oConn = new SqlConnection(DBConnectionString);
SqlDataAdapter dadCode = new SqlDataAdapter("sp_web_835_ddl_code",oConn)
;
DataSet dstCode = new DataSet();
dadCode.Fill(dstCode,"CodeTable");
// return dstCode;

DataView CodeView = new DataView(dstCode.Tables["CodeTables"]);
CodeView.RowFilter="type='F'";
return CodeView;
}

You sure it's called "CodeTable"? try omitting that once.
Also, you have "CodeTable" and "CodeTables"
Which is it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top