Board index » Web Programming » Why do I have to qualify 'DataRowView' with System.Data?

Why do I have to qualify 'DataRowView' with System.Data?

Web Programming238
I am getting the error below when I try to use DataRowView in my aspx page.

I am using the System.Data in my code behind. I even tried importing

system.Data in the aspx. I have to qualify it with System.Data to get it

going. Why is that?



Error Message:

The type or namespace name 'DataRowView' could not be found (are you

missing a using directive or an assembly reference?)



Karim


-
 

Re:Why do I have to qualify 'DataRowView' with System.Data?

You will have to post come code.



Are you using another namespace that has a DataRowView?





bill





"karim" <karim3411@11yahoo11.com>wrote in message

Quote
I am getting the error below when I try to use DataRowView in my aspx

page.

I am using the System.Data in my code behind. I even tried importing

system.Data in the aspx. I have to qualify it with System.Data to get it

going. Why is that?



Error Message:

The type or namespace name 'DataRowView' could not be found (are you

missing a using directive or an assembly reference?)



Karim





-

Re:Why do I have to qualify 'DataRowView' with System.Data?







On Thu, 10 Jul 2003 14:09:59 -0500, William F. Robertson, Jr. wrote:



Quote
You will have to post come code.



Are you using another namespace that has a DataRowView?





bill



This is line from the aspx file:



<asp:TextBox id=txtCarName Width="340px" runat="server" text='<%# ( (

System.Data.DataRowView ) Container.DataItem ) [ "AutoName" ]

%>'></asp:TextBox>















Quote




"karim" <karim3411@11yahoo11.com>wrote in message

news:a939d71265f7487bed4afbd43fc06f01@free.teranews.com...

>I am getting the error below when I try to use DataRowView in my aspx

page.

>I am using the System.Data in my code behind. I even tried importing

>system.Data in the aspx. I have to qualify it with System.Data to get it

>going. Why is that?

>

>Error Message:

>The type or namespace name 'DataRowView' could not be found (are you

>missing a using directive or an assembly reference?)

>

>Karim

-

Re:Why do I have to qualify 'DataRowView' with System.Data?

Yes, you have to do it that way. There is no using for an aspx page. When

a page is compiled all the "using" goes away and is replaced with the full

name of all the objects.



The using is just to help with typing and maintaining more readable code.



There is no other way around it. (That I can think of)



HTH,



bill





"karim" <karim3411@11yahoo11.com>wrote in message

Quote






On Thu, 10 Jul 2003 14:09:59 -0500, William F. Robertson, Jr. wrote:



>You will have to post come code.

>

>Are you using another namespace that has a DataRowView?

>

>

>bill



This is line from the aspx file:



<asp:TextBox id=txtCarName Width="340px" runat="server" text='<%# ( (

System.Data.DataRowView ) Container.DataItem ) [ "AutoName" ]

%>'></asp:TextBox>















>

>

>"karim" <karim3411@11yahoo11.com>wrote in message

>news:a939d71265f7487bed4afbd43fc06f01@free.teranews.com...

>>I am getting the error below when I try to use DataRowView in my aspx

>page.

>>I am using the System.Data in my code behind. I even tried importing

>>system.Data in the aspx. I have to qualify it with System.Data to get

it

>>going. Why is that?

>>

>>Error Message:

>>The type or namespace name 'DataRowView' could not be found (are you

>>missing a using directive or an assembly reference?)

>>

>>Karim





-

Re:Why do I have to qualify 'DataRowView' with System.Data?



"William F. Robertson, Jr." <wfrobertson@kpmg.com>wrote in message

Quote
Yes, you have to do it that way. There is no using for an aspx page.

When

a page is compiled all the "using" goes away and is replaced with the full

name of all the objects.





You should be able to use the



<%@ Import Namespace="System.Data" %>



directive to declare that the page is 'using' (in C# parlance) the

System.Data namespace.





Quote
The using is just to help with typing and maintaining more readable code.



There is no other way around it. (That I can think of)



HTH,



bill





"karim" <karim3411@11yahoo11.com>wrote in message

news:07c078cb6543cdf3c53251249dd89dc7@free.teranews.com...

>

>

>

>On Thu, 10 Jul 2003 14:09:59 -0500, William F. Robertson, Jr. wrote:

>

>>You will have to post come code.

>>

>>Are you using another namespace that has a DataRowView?

>>

>>

>>bill

>

>This is line from the aspx file:

>

><asp:TextBox id=txtCarName Width="340px" runat="server" text='<%# ( (

>System.Data.DataRowView ) Container.DataItem ) [ "AutoName" ]

>%>'></asp:TextBox>

>

>

>

>

>

>

>

>>

>>

>>"karim" <karim3411@11yahoo11.com>wrote in message

>>news:a939d71265f7487bed4afbd43fc06f01@free.teranews.com...

>>>I am getting the error below when I try to use DataRowView in my aspx

>>page.

>>>I am using the System.Data in my code behind. I even tried importing

>>>system.Data in the aspx. I have to qualify it with System.Data to get

it

>>>going. Why is that?

>>>

>>>Error Message:

>>>The type or namespace name 'DataRowView' could not be found (are you

>>>missing a using directive or an assembly reference?)

>>>

>>>Karim







--

MikeB





-

Re:Why do I have to qualify 'DataRowView' with System.Data?

You DON"t have to do it that way.



import the system.Data namespace in your code

or set it as a project-level import in project properties.





"karim" <karim3411@11yahoo11.com>wrote in message

Quote
I am getting the error below when I try to use DataRowView in my aspx

page.

I am using the System.Data in my code behind. I even tried importing

system.Data in the aspx. I have to qualify it with System.Data to get it

going. Why is that?



Error Message:

The type or namespace name 'DataRowView' could not be found (are you

missing a using directive or an assembly reference?)



Karim





-