R
R.A.M.
Hello,
I am writing ASP.NET application with will use custom web control
PS
SGridView (insertable grid view) downloaded from
http://www.codeproject.com/aspnet/PSGridView.asp.
My problem is that when user inserts/edits/deletes row in the control, an
error in occurs my application:
Message: Raised exception of type'System.Web.HttpUnhandledException'.
Stack: in System.Web.UI.Page.HandleError(Exception e) in
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) in
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) in System.Web.UI.Page.ProcessRequest()
in System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) in
System.Web.UI.Page.ProcessRequest(HttpContext context) in
ASP.units_aspx.ProcessRequest(HttpContext context) in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\mim-magazyn\ac16fb3b\d3ebb98f\App_Web_1xkbtcyc.2.cs:line 0 in
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
in System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Source: System.Web
Is it possible to say something about the reason of error from this
information?
I have installed PSControls assembly and required files in bin subfolder.
Here's how I use the PS
SGridView control:
File Units.aspx:
<%@ Page Language="C#" MasterPageFile="~/MIM-Magazyn.master"
AutoEventWireup="true" CodeFile="Units.aspx.cs" Inherits="Units"
Title="Jednostki miary" %>
<%@ Register Assembly="PSControls" Namespace="PS.Web.UI.WebControls"
TagPrefix="PS" %>
<asp:Content ID="Content" ContentPlaceHolderID="ContentPlaceHolder"
Runat="Server">
<asp:SqlDataSource ID="UnitsDataSource" runat="server"
DeleteCommand="DELETE FROM Units WHERE Unit = @Unit"
InsertCommand="INSERT INTO Units (Unit) VALUES (@Unit)"
SelectCommand="SELECT Unit FROM Units"
UpdateCommand="UPDATE Unit SET Unit = @Unit WHERE Unit = @Unit">
<DeleteParameters>
<asp
arameter Name="Unit" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp
arameter Name="Unit" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp
arameter Name="Unit" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<PS
SGridView ID="UnitsGridView" runat="server" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="UnitsDataSource" ShowFooter="True"
AddPrompt="" DataKeyNames="Unit" PageSize="12">
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle BackColor="#FFFFC0" />
<Columns>
<asp:TemplateField></asp:TemplateField>
<asp:BoundField DataField="Unit" HeaderText="Jednostka"
SortExpression="Unit" ReadOnly="False" />
</Columns>
</PS
SGridView>
</asp:Content>
File Units.aspx.cs (code-behind):
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// Editable Grid View of units
/// </summary>
public partial class Units : System.Web.UI.Page
{
/// <summary>
/// Initialize page and control
/// </summary>
protected void Page_Init(object sender, EventArgs e)
{
UnitsDataSource.ConnectionString = Admin.CurrentConnectionString;
}
/// <summary>
/// Display units Grid View
/// </summary>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
UnitsGridView.IsEditable = true;
}
}
Could you help me please to find why the error occurs? Thanks in advance.
/RAM/
I am writing ASP.NET application with will use custom web control
PS
http://www.codeproject.com/aspnet/PSGridView.asp.
My problem is that when user inserts/edits/deletes row in the control, an
error in occurs my application:
Message: Raised exception of type'System.Web.HttpUnhandledException'.
Stack: in System.Web.UI.Page.HandleError(Exception e) in
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) in
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) in System.Web.UI.Page.ProcessRequest()
in System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) in
System.Web.UI.Page.ProcessRequest(HttpContext context) in
ASP.units_aspx.ProcessRequest(HttpContext context) in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\mim-magazyn\ac16fb3b\d3ebb98f\App_Web_1xkbtcyc.2.cs:line 0 in
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
in System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Source: System.Web
Is it possible to say something about the reason of error from this
information?
I have installed PSControls assembly and required files in bin subfolder.
Here's how I use the PS
File Units.aspx:
<%@ Page Language="C#" MasterPageFile="~/MIM-Magazyn.master"
AutoEventWireup="true" CodeFile="Units.aspx.cs" Inherits="Units"
Title="Jednostki miary" %>
<%@ Register Assembly="PSControls" Namespace="PS.Web.UI.WebControls"
TagPrefix="PS" %>
<asp:Content ID="Content" ContentPlaceHolderID="ContentPlaceHolder"
Runat="Server">
<asp:SqlDataSource ID="UnitsDataSource" runat="server"
DeleteCommand="DELETE FROM Units WHERE Unit = @Unit"
InsertCommand="INSERT INTO Units (Unit) VALUES (@Unit)"
SelectCommand="SELECT Unit FROM Units"
UpdateCommand="UPDATE Unit SET Unit = @Unit WHERE Unit = @Unit">
<DeleteParameters>
<asp
</DeleteParameters>
<UpdateParameters>
<asp
</UpdateParameters>
<InsertParameters>
<asp
</InsertParameters>
</asp:SqlDataSource>
<PS
AutoGenerateColumns="False" DataSourceID="UnitsDataSource" ShowFooter="True"
AddPrompt="" DataKeyNames="Unit" PageSize="12">
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle BackColor="#FFFFC0" />
<Columns>
<asp:TemplateField></asp:TemplateField>
<asp:BoundField DataField="Unit" HeaderText="Jednostka"
SortExpression="Unit" ReadOnly="False" />
</Columns>
</PS
</asp:Content>
File Units.aspx.cs (code-behind):
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// Editable Grid View of units
/// </summary>
public partial class Units : System.Web.UI.Page
{
/// <summary>
/// Initialize page and control
/// </summary>
protected void Page_Init(object sender, EventArgs e)
{
UnitsDataSource.ConnectionString = Admin.CurrentConnectionString;
}
/// <summary>
/// Display units Grid View
/// </summary>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
UnitsGridView.IsEditable = true;
}
}
Could you help me please to find why the error occurs? Thanks in advance.
/RAM/