PC Review


Reply
Thread Tools Rate Thread

DataView returns 0 rows

 
 
Andy Sutorius via DotNetMonster.com
Guest
Posts: n/a
 
      10th Jun 2005
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;
}

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...o-net/200506/1
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGF2ZVZC?=
Guest
Posts: n/a
 
      10th Jun 2005
Andy,
The name of your table when you create the dataview is "CodeTables" ...plural.
The name of the table filled is "CodeTable"...singular.

Check to be sure the names are the same.

Hope this helps,
Dave


"Andy Sutorius via DotNetMonster.com" wrote:

> 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;
> }
>
> --
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/For...o-net/200506/1
>

 
Reply With Quote
 
William Ryan eMVP
Guest
Posts: n/a
 
      12th Jun 2005
Andy - DaveVB answered your question.. it's the spelling. HOwever absent a
good reason to use Untyped DataSets, using Typed Datasets do provide you
not only performance benefits, but you can have the compiler help you out ot
make sure that typos and the like don't occur. I've made this same mistake
with datatable names and colum names so many times that using untyped
datasets now gives me the same icky feeling of not wearing a setbelt.


--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"Andy Sutorius via DotNetMonster.com" <(E-Mail Removed)> wrote
in message news:(E-Mail Removed)...
> 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;
> }
>
> --
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/For...o-net/200506/1



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      12th Jun 2005
Bill,

>using Typed Datasets do provide you not only performance benefits,


Not arguing about the rest of your message. However can you tell me about
this why.

In fact a typed dataset cost more time. (What is just an accepted thing from
OOP and than we are talking about pieces of nanoseconds).

However, a performance benefit I can absolute not see. It's just and
inherited untyped dataset.

So enlighten me in this, why you write this forever?

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Way of Deleting All Rows in a DataView =?Utf-8?B?bWljaGFlbA==?= Microsoft ADO .NET 4 13th Feb 2006 08:53 AM
Dataview returns 0 rows Andy Sutorius via DotNetMonster.com Microsoft ASP .NET 2 10th Jun 2005 04:16 PM
Dataview returns 0 rows Andy Sutorius via DotNetMonster.com Microsoft Dot NET 0 10th Jun 2005 03:28 PM
method type ICollection returns Dataview Janus Knudsen Microsoft ASP .NET 1 6th Jul 2004 07:04 AM
dataview with few rows Sunil Ramineni Microsoft ADO .NET 3 21st Feb 2004 02:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:23 PM.