Home All Groups Group Topic Archive Search About
Author
10 Jun 2005 2:38 PM
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;
}


Author
10 Jun 2005 2:45 PM
Curt_C [MVP]
Andy Sutorius via DotNetMonster.com wrote:
Show quoteHide quote
> 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?

--
Curt Christianson
site: www.darkfalz.com
blog: blog.darkfalz.com
Are all your drivers up to date? click for free checkup

Author
10 Jun 2005 3:16 PM
Andy Sutorius via DotNetMonster.com
Curt,

Thank you! Misspelling. Ugh!

Andy

Curt_C [MVP] wrote:
Show quoteHide quote
>> Hi,
>>
>[quoted text clipped - 19 lines]
>>    return CodeView;
>> }
>
>You sure it's called "CodeTable"? try omitting that once.
>Also, you have "CodeTable" and "CodeTables"
>Which is it?
>

--
Message posted via http://www.dotnetmonster.com

Bookmark and Share