I'm trying to use LINQ for the first time and something very simple doesn't seem to work...
I have a single table that I'm linking with a LinqDataSource. I enabled the update, insert and delete options.
The problem is that I am not given permission to modify anything in my gridview...
Here is my .aspx
Code: Select all
// Ce code a été généré par un outil.
// Version du runtime :2.0.50727.3053
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
//
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
[System.Data.Linq.Mapping.DatabaseAttribute(Name="MSPlanif")]
public partial class DataClassesDataContext : System.Data.Linq.DataContext
{
private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
#region Extensibility Method Definitions
partial void OnCreated();
partial void InsertHelpRequests(HelpRequests instance);
partial void UpdateHelpRequests(HelpRequests instance);
partial void DeleteHelpRequests(HelpRequests instance);
#endregion
public DataClassesDataContext() :
base(global::System.Configuration.ConfigurationManager.ConnectionStrings["MSPlanifConnectionString"].ConnectionString, mappingSource)
{
OnCreated();
}
public DataClassesDataContext(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
public DataClassesDataContext(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
public DataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public DataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public System.Data.Linq.Table HelpRequests
{
get
{
return this.GetTable();
}
}
}
[Table(Name="PLANIF.HelpRequests")]
public partial class HelpRequests : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _HelpRequestID;
private int _TeamPlanningResourceID;
private System.DateTime _RequestDate;
private string _RequestComment;
private System.Nullable _RequestedBy;
private System.Nullable _RequestSolved;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnHelpRequestIDChanging(int value);
partial void OnHelpRequestIDChanged();
partial void OnTeamPlanningResourceIDChanging(int value);
partial void OnTeamPlanningResourceIDChanged();
partial void OnRequestDateChanging(System.DateTime value);
partial void OnRequestDateChanged();
partial void OnRequestCommentChanging(string value);
partial void OnRequestCommentChanged();
partial void OnRequestedByChanging(System.Nullable value);
partial void OnRequestedByChanged();
partial void OnRequestSolvedChanging(System.Nullable value);
partial void OnRequestSolvedChanged();
#endregion
public HelpRequests()
{
OnCreated();
}
[Column(Storage="_HelpRequestID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
public int HelpRequestID
{
get
{
return this._HelpRequestID;
}
set
{
if ((this._HelpRequestID != value))
{
this.OnHelpRequestIDChanging(value);
this.SendPropertyChanging();
this._HelpRequestID = value;
this.SendPropertyChanged("HelpRequestID");
this.OnHelpRequestIDChanged();
}
}
}
[Column(Storage="_TeamPlanningResourceID", DbType="Int NOT NULL")]
public int TeamPlanningResourceID
{
get
{
return this._TeamPlanningResourceID;
}
set
{
if ((this._TeamPlanningResourceID != value))
{
this.OnTeamPlanningResourceIDChanging(value);
this.SendPropertyChanging();
this._TeamPlanningResourceID = value;
this.SendPropertyChanged("TeamPlanningResourceID");
this.OnTeamPlanningResourceIDChanged();
}
}
}
[Column(Storage="_RequestDate", DbType="SmallDateTime NOT NULL")]
public System.DateTime RequestDate
{
get
{
return this._RequestDate;
}
set
{
if ((this._RequestDate != value))
{
this.OnRequestDateChanging(value);
this.SendPropertyChanging();
this._RequestDate = value;
this.SendPropertyChanged("RequestDate");
this.OnRequestDateChanged();
}
}
}
[Column(Storage="_RequestComment", DbType="VarChar(4000)")]
public string RequestComment
{
get
{
return this._RequestComment;
}
set
{
if ((this._RequestComment != value))
{
this.OnRequestCommentChanging(value);
this.SendPropertyChanging();
this._RequestComment = value;
this.SendPropertyChanged("RequestComment");
this.OnRequestCommentChanged();
}
}
}
[Column(Storage="_RequestedBy", DbType="Int")]
public System.Nullable RequestedBy
{
get
{
return this._RequestedBy;
}
set
{
if ((this._RequestedBy != value))
{
this.OnRequestedByChanging(value);
this.SendPropertyChanging();
this._RequestedBy = value;
this.SendPropertyChanged("RequestedBy");
this.OnRequestedByChanged();
}
}
}
[Column(Storage="_RequestSolved", DbType="Bit")]
public System.Nullable RequestSolved
{
get
{
return this._RequestSolved;
}
set
{
if ((this._RequestSolved != value))
{
this.OnRequestSolvedChanging(value);
this.SendPropertyChanging();
this._RequestSolved = value;
this.SendPropertyChanged("RequestSolved");
this.OnRequestSolvedChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
#pragma warning restore 1591