Having trouble figuring out how to get this binded to a datatable and run a foreach query on it.
My goal is to have an initial query ran that returns a list of id numbers from sql. Then it puts it to a datatable where i can run a foreach row value in the datatable and run a sql query and add them to a dataset that is then binded to a gridview in asp.net
Here is what I have so far.
SqlConnection sqlconnection1 = new SqlConnection(ConfigurationManager.ConnectionStrings["outlook"].ConnectionString);
SqlCommand cmd5 = sqlconnection1.CreateCommand();
cmd5.CommandText = "SELECT xrefid from outlookreport.dbo.assignloans where userid=@userid" ;
SqlDataAdapter da = new SqlDataAdapter(cmd5);