Question

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?

Was it helpful?

Solution

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!

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top