Lilz Lilz - 2 months ago 9
ASP.NET (C#) Question

Dataset in html

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?

Answer

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!

Comments