Sunday, November 23, 2014

asp.net convert data from object to string

  string advisorId = Convert.ToString(_webcontext.GetFromSession("AdvisorId"));

asp.net abstract data from dataset

 ds = _categorymappingpresenter.getCategories(advisorId);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                category_entity.AdvisorId = Convert.ToString(_webcontext.GetFromSession("AdvisorId"));
                category_entity.Action = "U";
                category_entity.CategoryName = ds.Tables[0].Rows[i]["CategoryName"].ToString();
                category_entity.CategoryRating = ds.Tables[0].Rows[i]["Id"].ToString();
                category_entity.CategoryId = Convert.ToInt32(ds.Tables[0].Rows[i]["CategoryId"]);
                category_entity.Result = _categorymappingpresenter.addModifyCategory(category_entity);

            }

asp.net for loop on dataset

 ds = _categorymappingpresenter.getCategories(advisorId);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                category_entity.AdvisorId = Convert.ToString(_webcontext.GetFromSession("AdvisorId"));
                category_entity.Action = "U";
                category_entity.CategoryName = ds.Tables[0].Rows[i]["CategoryName"].ToString();
                category_entity.CategoryRating = ds.Tables[0].Rows[i]["Id"].ToString();
                category_entity.CategoryId = Convert.ToInt32(ds.Tables[0].Rows[i]["CategoryId"]);
                category_entity.Result = _categorymappingpresenter.addModifyCategory(category_entity);

            }

asp.net find Textbox text from gridview row

  category_entity.CategoryName = ((TextBox)GridView1.Rows[e.RowIndex]
                               .FindControl("txtCategoryName")).Text;

asp.net find label text from gridview row

  category_entity.CategoryId = Convert.ToInt32(((Label)GridView1.Rows[e.RowIndex]
                               .FindControl("lblCategoryId")).Text);

Tuesday, October 28, 2014

SharePoint App Deployment error : 'Failed to install app for SharePoint' There was a problem with activating the app web definition

It is because SharePoint is trying to activate your app as a standard SharePoint feature, when its really an App.
In the features folder of the SharePoint project, there will be a Feature named Feature1.
Open Feature1 and ensure it's contained in the "Items in the solution" list and not in the "Items in the feature" list.
After that you should be able to deploy.