views:

200

answers:

2

Hi,

I am using asp.net and i would like to define the elements of a dataset in my html code. The problem is when i attempt to use:

<%@Using namespace="System.Data" %>

this is giving me an error

also

I am using

foreach (DataRow row in ds.Tables[0].Rows)
          {.....}

DataSet ds is obtained from an sql query. I don't believe to have any tables so is the above code ok?

Thank you so much!!

+2  A: 

If ds was defined in the code-behind for it to be available in the .aspx side of things you must declare it as protected, rather than private.

Mitchel Sellers
+1  A: 

If you want to import a namespace in the aspx page, try this:

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

If you're more specific about your error, we can help you there too!

JerSchneid
actually thats what i really needed :)thanks
Lily