Posts

Showing posts from November, 2013

How to retreive value from a list and display it in a GridView in SharePoint Through Visual Studio

using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls. WebParts; using System.Data; using System.Collections; using System.Collections.Generic; using Microsoft.SharePoint; namespace Sun_SharePointProject2. sunVisualWebPart1 {     class Data     {         public string studentId { get; set;}         public string name {get; set;}         public string address {get; set;}         public string section { get; set; }     }     public partial class sunVisualWebPart1UserControl : UserControl     {         protected void Page_Load(object sender, EventArgs e)         {             try             {                 SPList info = SPContext.Current.Web.Lists[" Student List"];                 List<Data> data = new List<Data>();                 foreach (SPListItem item in info.Items)                 {                     Data d = new Data();                     d.studentId = item["Student ID&quo

Code for adding registration form on SharePoint through Visual Sudio

using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls. WebParts; using System.Data; using System.Collections; using System.Collections.Generic; using Microsoft.SharePoint; namespace Sun_SharePointProject2. sunVisualWebPart1 {     class Data     {         public string studentId { get; set;}         public string name {get; set;}         public string address {get; set;}         public string section { get; set; }     }     public partial class sunVisualWebPart1UserControl : UserControl     {         protected void Page_Load(object sender, EventArgs e)         {             try             {                 SPList info = SPContext.Current.Web.Lists[" Student List"];                 List<Data> data = new List<Data>();                 foreach (SPListItem item in info.Items)                 {                     Data d = new Data();                     d.studentId = item["Student ID"].ToString();      

How to alter column definition in SQL

Alter table test add constraint pk  primary key clustered( USerId )

Delete multiple asp.net gridview rows with checkbox selection and with confirmation

Introduction: In this article I will explain how to delete multiple rows in gridview with checkbox selection and with confirmation message using asp.net. Description: I have one gridvew that contains multiple rows with checkboxes now my requirement is to delete rows in gridview based on checkbox selection. First design the table in database and give name UserInformation ColumnName DataType UserId Int(set identity property=true) UserName varchar(50) FirstName varchar(50) LastName varchar(50) Location varchar(50) After completion table creation enter some dummy and design your aspx page like this < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server"> < title > Delete Rows in Gridview with Checkbox </ title > < style type ="text/css"> .Gridview { font-family:Verdana; font-size:10pt; font-
go to top image