0
for(int p=0; p<dsForumList; p++)
    {   
     dsForumList="select ForumName from KF_Fourms";
      {   
        if(dsForumList.Tables.Count > 0)
           {
             if (dsForumList.Tables[0].Rows.Count > 
               {
                  for (int i = 0; i < dsForumList.Tables[0].Rows.Count; i++)
                      {
                          strForumName = Convert.ToString(dsForumList.Tables[0].Rows[i]["ForumName"]);

                              // strForumName =Convert.ToString (dsForumList .Tables [0].Rows[i]["ForumName"]);
                              for (int j = 0; j < dsCategoryList.Tables[0].Rows.Count; j++)
                                   {
                                      //intCategoryID = Convert.ToInt32(ds.Tables[0].Rows[i]["CategoryID"]);
                                      strCategoryName = Convert.ToString(dsCategoryList.Tables[0].Rows[j]["CategoryName"]);
                                   }
                      }
              }   
      }
 } for(int p=0; p<dsForumList; p++)
    {   
     dsForumList="select ForumName from KF_Fourms";
      {   
        if(dsForumList.Tables.Count > 0)
           {
             if (dsForumList.Tables[0].Rows.Count > 
               {
                  for (int i = 0; i < dsForumList.Tables[0].Rows.Count; i++)
                      {
                          strForumName = Convert.ToString(dsForumList.Tables[0].Rows[i]["ForumName"]);

                              // strForumName =Convert.ToString (dsForumList .Tables [0].Rows[i]["ForumName"]);
                              for (int j = 0; j < dsCategoryList.Tables[0].Rows.Count; j++)
                                   {
                                      //intCategoryID = Convert.ToInt32(ds.Tables[0].Rows[i]["CategoryID"]);
                                      strCategoryName = Convert.ToString(dsCategoryList.Tables[0].Rows[j]["CategoryName"]);
                                   }
                      }
              }   
      }
 }

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by jbisono
0

the basic code to retrieve data to a dataset is like this.

SqlConnection conn = new SqlConnection("ConnectionString");
DataSet ds = new DataSet();
String sqlStatement = "Select FIelds From Table";
SqlDataAdapter adapt = new SqlDataAdapter(sqlStatement, conn);
adapt.Fill(ds);

now you have you result set into the dataset, then you can play with it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.