- Home
- LLBLGen Pro
- LLBLGen Pro Runtime Framework
Error with DataAccesAdapter
Joined: 29-Nov-2008
error is :
This DataAccessAdapter instance has already been disposed, you can't use it for further persistence activity Object name: 'DataAccessAdapterBase'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ObjectDisposedException: This DataAccessAdapter instance has already been disposed, you can't use it for further persistence activity Object name: 'DataAccessAdapterBase'.
Source Error:
Line 65: if (!IsPostBack) Line 66: { Line 67: GVAssignID2A.DataBind(); Line 68: } Line 69: //EntityCollection machines = new EntityCollection(new MachineEntityFactory());
I have attached the code behind and ascx page as well . please tell me why it is happening.
i matrying to use Iprefetch
Filename | File size | Added on | Approval |
---|---|---|---|
AssignInstsDbsSchemas.ascx.cs | 4,797 | 12-Dec-2008 22:41.55 | Approved |
Joined: 29-Nov-2008
ascx page
Filename | File size | Added on | Approval |
---|---|---|---|
AssignInstsDbsSchemas.ascx | 8,946 | 12-Dec-2008 22:42.43 | Approved |
Joined: 29-Nov-2008
System.ObjectDisposedException was unhandled by user code Message="This DataAccessAdapter instance has already been disposed, you can't use it for further persistence activity\r\nObject name: 'DataAccessAdapterBase'." Source="SD.LLBLGen.Pro.ORMSupportClasses.NET20" ObjectName="DataAccessAdapterBase" StackTrace: at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.OpenConnection() at SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelectEntityCollection(Int32 pageSize, Int32 pageNumber, DataSourceSelectArguments arguments) at SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.GridView.DataBind() at ENVWeb.AssignInstsDbsSchemas.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\NBKVKMM\Desktop\ENVWeb__dec12th11.26\ENVWeb\AssignInstsDbsSchemas.ascx.cs:line 58 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException:
This is the error coming.
Can anybody please help.
Do you made a customization of the DataAccessAdapter class? LLBLGen version and Runtime library version?
(Edit) You have the mAdapter as a private page-level object. So, why are you doing this?
using (DataAccessAdapter mAdapter = new DataAccessAdapter())
{
GVAssignID2A.PageSize = 15;
}
Joined: 29-Nov-2008
Hi Daelmo,
Thanks for your help.but we have implemented this kind of things in our project and there are many ascx pages which wokr fine. Only this one gives us problems.Is it because i am prefetching the data and i am not using any dataaccesadapter.Here is the recet code, Please check and leme know if i need to changeanything here. i am struggling for two days now with this.Please help.
error message is :
This DataAccessAdapter instance has already been disposed, you can't use it for further persistence activity Object name: 'DataAccessAdapterBase'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ObjectDisposedException: This DataAccessAdapter instance has already been disposed, you can't use it for further persistence activity Object name: 'DataAccessAdapterBase'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ObjectDisposedException: This DataAccessAdapter instance has already been disposed, you can't use it for further persistence activity Object name: 'DataAccessAdapterBase'.] SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.OpenConnection() +325 SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelectEntityCollection(Int32 pageSize, Int32 pageNumber, DataSourceSelectArguments arguments) +323 SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelect(DataSourceSelectArguments arguments) +174 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.FormView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.FormView.EnsureDataBound() +163 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +50 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +62 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041
when i exclude this page , error goes and we are normal.what could be the reason with this page. Please let me know if need to do anything else in the page before trying to access data.
i tried many things. nothing seems to work.
code behind page is as below :
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; using SD.LLBLGen.Pro.ORMSupportClasses; using ENVWeb.DAL; using ENVWeb.DAL.DatabaseSpecific; using ENVWeb.DAL.EntityClasses; using ENVWeb.DAL.FactoryClasses; using ENVWeb.DAL.HelperClasses; using ENVWeb.DAL.RelationClasses; using ENVWeb.DAL.TypedListClasses; using ENVWeb.BLL;
namespace ENVWeb { public partial class AssignInstsDbsSchemas : System.Web.UI.UserControl { private MachineTypedList mList; private DataAccessAdapter mAdaptersecond; private IGroupByCollection group; private IEntityFields2 fields;
private string FilterExpression
{
// casting to string is used instead of ToString because returning a null string is valid and ToString will throw an exception if the value is null
get { return (string)ViewState["FEMachineView"]; }
set { ViewState["FEMachineView"] = value; }
}
private IRelationPredicateBucket Filter
{
get { return (IRelationPredicateBucket)ViewState["FMachineView"]; }
set { ViewState["FMachineView"] = value; }
}
protected void GVListBind(int pagenum, int pagesize)
{
using (DataAccessAdapter mAdaptersecond = new DataAccessAdapter())
{
mAdaptersecond.OpenConnection();
mAdaptersecond.FetchTypedList(fields, mList, Filter, 0, null, false, group, 0, 0);
if (mList.Count == 0)
{
Filter.PredicateExpression.Clear();
mAdaptersecond.FetchTypedList(fields, mList, Filter, 0, null, false, group, 0, 0);
}
ViewState["Gridinfo"] = mList;
mList = (MachineTypedList)ViewState["Gridinfo"];
GVMachineViewList.DataSource = mList;
GVMachineViewList.AutoGenerateColumns = false;
GVMachineViewList.PageIndex = pagenum;
GVMachineViewList.DataBind();
}
}
protected void Page_Load(object sender, EventArgs e)
{
GVMachineViewList.PageSize = 15;
GVInstances.PageSize = 5;
mList = new MachineTypedList();
fields = mList.GetFieldsInfo();
if (Filter == null)
{
IRelationPredicateBucket f;
f = mList.GetRelationInfo();
Filter = f;
}
if (!IsPostBack)
{
GVListBind(0, 25);
}
/*
ODSInstance.PrefetchPathToUse = new PrefetchPath2((int)EntityType.VDbsBymachineEntity);
ODSInstance.PrefetchPathToUse.Add(VDbsBymachineEntity.PrefetchPathAppAit);
ODSInstance.PrefetchPathToUse.Add(VDbsBymachineEntity.PrefetchPathApplication);
*/
IPrefetchPath2 p = new PrefetchPath2((int)EntityType.VDbsBymachineEntity);
p.Add(VDbsBymachineEntity.PrefetchPathAppAit);
p.Add(VDbsBymachineEntity.PrefetchPathApplication);
ODSInstance.PrefetchPathToUse = p;
}
protected void GVMachineViewList_ClearFilter(object sender, EventArgs e)
{
Filter.PredicateExpression.Clear();
GVListBind(0, 25);
}
protected void GVMachineViewList_TextChanged(object sender, EventArgs e)
{
TextBox a = (TextBox)sender;
FilterExpression = a.Text + "%";
Filter.PredicateExpression.Clear();
switch (a.ID)
{
case "TBMachineId":
Filter.PredicateExpression.Add(MachineFields.MachineId % FilterExpression);
break;
case "TBOsNm":
Filter.PredicateExpression.Add(MachineFields.OsNm % FilterExpression);
break;
default:
break;
}
GVListBind(0, 25);
}
protected void Update_Click(object sender, EventArgs e)
{
//FVMachineDetail.ChangeMode = FormViewMode.ReadOnly;
}
protected void GVMachineViewList_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GVListBind(e.NewPageIndex, 200);
}
protected void GVMachineViewList_DataBound(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Call method to display the current page number when the page is first loaded.
DisplayCurrentPage();
}
}
void DisplayCurrentPage()
{
int CurrentPage = GVMachineViewList.PageIndex + 1;
lblGVMachineViewList.Text = "Page" + " " + CurrentPage.ToString() + " " + "of" + " " + GVMachineViewList.PageCount.ToString() + ".";
}
protected void FVMachineDetail_PageIndexChanging(object sender, FormViewPageEventArgs e)
{
}
}
}
ascx page is as below :
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AssignInstsDbsSchemas.ascx.cs" Inherits="ENVWeb.AssignInstsDbsSchemas" %> <%@ Register Assembly="SD.LLBLGen.Pro.ORMSupportClasses.NET20" Namespace="SD.LLBLGen.Pro.ORMSupportClasses" TagPrefix="llblgenpro" %> <asp:ScriptManagerProxy ID="SMP" runat="server"></asp:ScriptManagerProxy> <link id="Link1" href="Master.css" rel="stylesheet" runat="server" type="text/css" /> <asp:UpdatePanel ID="UPMachineView" UpdateMode="conditional" runat="server"> <ContentTemplate> <table> <tr> <td rowspan="2" valign="top"> <table style="width:100%;"> <tr> <td> <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="conditional" runat="server"> <ContentTemplate> <asp:GridView ID="GVMachineViewList" runat="server" AllowPaging="True" PageSize="15" OnPageIndexChanging="GVMachineViewList_PageIndexChanging" AutoGenerateColumns="False" DataKeyNames="MachineId" EnableViewState ="true" DataMember="DefaultView" ondatabound="GVMachineViewList_DataBound"> <Columns> <asp:TemplateField> <HeaderStyle Wrap="false" /> <HeaderTemplate> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="/Images/remove-item-red.gif" CausesValidation="true" OnClick="GVMachineViewList_ClearFilter"/> </HeaderTemplate> <ItemStyle Wrap="false" /> <ItemTemplate> <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="/Images/select-item-red.gif" CommandName="Select"/> </ItemTemplate> </asp:TemplateField>
<asp:TemplateField>
<HeaderStyle Wrap="false" />
<HeaderTemplate>
<asp:Literal runat="server" ID="LITMachineId" Text="Machine ID" />
<br />
<asp:TextBox ID="TBMachineId" runat="server" AutoPostBack="True" OnTextChanged="GVMachineViewList_TextChanged" Columns="10" CssClass="textbox" />
</HeaderTemplate>
<ItemTemplate>
<asp:Literal runat="server" ID="LMachineId" Text='<%# Eval("MachineId") %>' ></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Literal ID="lblOsNm" runat="server" Text="OS Name"></asp:Literal>
<br />
<asp:TextBox ID="TBOsNm" runat="server" AutoPostBack="True" OnTextChanged="GVMachineViewList_TextChanged" Columns="10" CssClass="textbox" />
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LOsNm" runat="server" Text='<%# Eval("OsNm") %>'> </asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate><asp:Label ID="Label1" runat="server" Text="Machine </br>Indicator"></asp:Label></HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LInactiveIn" runat="server" Text='<%# Eval("InactiveIn").ToString().Substring(0,1) %>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label ID="lblGVMachineViewList" runat="server"></asp:Label>
</td>
</tr>
</table>
</td>
<td valign="top">
<table>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel3" UpdateMode="conditional" runat="server">
<ContentTemplate>
<asp:FormView ID="FVMachineDetail" runat="server" DataKeyNames="MachineId"
DataSourceID="ODSMachineDetail" BorderStyle="Solid" DefaultMode="ReadOnly"
EmptyDataText="No Data to Display" GridLines="Vertical" onpageindexchanging="FVMachineDetail_PageIndexChanging"
>
<EditItemTemplate>
<table class="formdata" cellpadding="2px" cellspacing="0px">
<tr>
<td class="Theader">Machine ID:</td>
<td class="Tdata"><asp:Label ID="MachineIdLabel1" runat="server" Text='<%# Eval("MachineId") %>'></asp:Label></td>
<td class="Theader">Physical Processor Count:</td>
<td class="Tdata"><asp:Label ID="PhysProcessorCntLabel" runat="server" Text='<%# Bind("PhysProcessorCnt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Serial Number:</td>
<td class="Tdata"><asp:Label ID="SerialNmbrLabel" runat="server" Text='<%# Bind("SerialNmbr") %>'></asp:Label></td>
<td class="Theader">Total DASD:</td>
<td class="Tdata"><asp:Label ID="TotalDasdLabel" runat="server" Text='<%# Bind("TotalDasd") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Windows Domain Name:</td>
<td class="Tdata"><asp:Label ID="WindowsDomainNmLabel" runat="server" Text='<%# Bind("WindowsDomainNm") %>'></asp:Label></td>
<td class="Theader">OS Name:</td>
<td class="Tdata"><asp:Label ID="OsNmLabel" runat="server" Text='<%# Bind("OsNm") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">DNS Domain Name:</td>
<td class="Tdata"><asp:Label ID="DnsDomainNmLabel" runat="server" Text='<%# Bind("DnsDomainNm") %>'></asp:Label></td>
<td class="Theader">OS Version:</td>
<td class="Tdata"><asp:Label ID="OsVersionLabel" runat="server" Text='<%# Bind("OsVersion") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Environment:</td>
<td class="Tdata">
<asp:TextBox ID="EnvironmentNmLabel" runat="server" Text='<%# Bind("EnvironmentNm") %>'></asp:TextBox>
<%--<asp:ListBox ID="LBEnvironmentNm" runat="server" DataSourceID="ODSEnvir" DataTextField="EnvironmentNm" Height="20px" Rows="1" Width="100px"/>--%>
</td>
<td class="Theader">Created Date:</td>
<td class="Tdata"><asp:Label ID="CreateDtLabel" runat="server" Text='<%# Bind("CreateDt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Mailcode:</td>
<td class="Tdata"><asp:Label ID="MailcodeLabel" runat="server" Text='<%# Bind("Mailcode") %>'></asp:Label></td>
<td class="Theader">Inactive Indicator:</td>
<td class="Tdata"><asp:CheckBox ID="InactiveInCheckBox" Enabled="false" runat="server" Checked='<%# Bind("InactiveIn") %>' BorderStyle="none" /></td>
</tr>
<tr>
<td class="Theader">Vendor:</td>
<td class="Tdata"><asp:Label ID="Label2" runat="server" Text='<%# Bind("VendorNm") %>'></asp:Label></td>
<td class="Theader">Inactivated Date:</td>
<td class="Tdata"><asp:Label ID="InactiveDtTextBox" runat="server" Text='<%# Bind("InactiveDt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Model:</td>
<td class="Tdata"><asp:Label ID="Label4" runat="server" Text='<%# Bind("Model") %>'></asp:Label></td>
<td class="Theader">TMR Region:</td>
<td class="Tdata"><asp:Label ID="TMRRegionLabel" runat="server" Text='<%# Bind("TMRRegion") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Memory:</td>
<td class="Tdata"><asp:Label ID="Label6" runat="server" Text='<%# Bind("Memory") %>'></asp:Label></td>
<td class="Theader">ICM:</td>
<td class="Tdata"><asp:TextBox ID="ICMTextBox" runat="server" Text='<%# Bind("ICM") %>' /></td>
</tr>
<tr>
<td class="Theader">Processor Type:</td>
<td class="Tdata"><asp:Label ID="Label8" runat="server" Text='<%# Bind("ProcessorType") %>'></asp:Label></td>
<td class="Theader">CAB:</td>
<td class="Tdata"><asp:TextBox ID="CABTextBox" runat="server" Text='<%# Bind("CAB") %>'></asp:TextBox></td>
</tr>
<tr>
<td class="Theader">Processor Speed:</td>
<td class="Tdata"><asp:Label ID="Label10" runat="server" Text='<%# Bind("ProcessorSpeed") %>'></asp:Label></td>
<td class="Theader">Keyword:</td>
<td class="Tdata"><asp:TextBox ID="KeywordsTextBox" runat="server" Text='<%# Bind("Keywords") %>'></asp:TextBox></td>
</tr>
<tr>
<td colspan="4" align="right">
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" OnClick="Update_Click"/>
<asp:Button ID="UpdateCancelButton" runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel" />
</td>
</tr>
</table>
</EditItemTemplate>
<InsertItemTemplate>
<table class="formdata" cellpadding="2px" cellspacing="0px">
<tr>
<td class="Theader">Machine ID:</td>
<td class="Tdata"><asp:Label ID="MachineIdLabel1" runat="server" Text='<%# Eval("MachineId") %>'></asp:Label></td>
<td class="Theader">Physical Processor Count:</td>
<td class="Tdata"><asp:Label ID="PhysProcessorCntLabel" runat="server" Text='<%# Bind("PhysProcessorCnt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Serial Number:</td>
<td class="Tdata"><asp:Label ID="SerialNmbrLabel" runat="server" Text='<%# Bind("SerialNmbr") %>'></asp:Label></td>
<td class="Theader">Total DASD:</td>
<td class="Tdata"><asp:Label ID="TotalDasdLabel" runat="server" Text='<%# Bind("TotalDasd") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Windows Domain Name:</td>
<td class="Tdata"><asp:Label ID="WindowsDomainNmLabel" runat="server" Text='<%# Bind("WindowsDomainNm") %>'></asp:Label></td>
<td class="Theader">OS Name:</td>
<td class="Tdata"><asp:Label ID="OsNmLabel" runat="server" Text='<%# Bind("OsNm") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">DNS Domain Name:</td>
<td class="Tdata"><asp:Label ID="DnsDomainNmLabel" runat="server" Text='<%# Bind("DnsDomainNm") %>'></asp:Label></td>
<td class="Theader">OS Version:</td>
<td class="Tdata"><asp:Label ID="OsVersionLabel" runat="server" Text='<%# Bind("OsVersion") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Environmnet:</td>
<td class="Tdata">
<asp:TextBox ID="EnvironmentNmLabel" runat="server" Text='<%# Bind("EnvironmentNm") %>'></asp:TextBox>
<%--<asp:ListBox ID="LBEnvironmentNm" runat="server" DataSourceID="ODSEnvir" DataTextField="EnvironmentNm" Height="20px" Rows="1" Width="100px"/>--%>
</td>
<td class="Theader">Created Date:</td>
<td class="Tdata"><asp:Label ID="CreateDtLabel" runat="server" Text='<%# Bind("CreateDt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Mailcode:</td>
<td class="Tdata"><asp:Label ID="MailcodeLabel" runat="server" Text='<%# Bind("Mailcode") %>'></asp:Label></td>
<td class="Theader">Inactive Indicator:</td>
<td class="Tdata"><asp:CheckBox ID="InactiveInCheckBox" Enabled="false" runat="server" Checked='<%# Bind("InactiveIn") %>' BorderStyle="none" /></td>
</tr>
<tr>
<td class="Theader">Vendor:</td>
<td class="Tdata"><asp:Label ID="Label2" runat="server" Text='<%# Bind("VendorNm") %>'></asp:Label></td>
<td class="Theader">Inactivated Date:</td>
<td class="Tdata"><asp:Label ID="InactiveDtTextBox" runat="server" Text='<%# Bind("InactiveDt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Model:</td>
<td class="Tdata"><asp:Label ID="Label4" runat="server" Text='<%# Bind("Model") %>'></asp:Label></td>
<td class="Theader">TMR Region:</td>
<td class="Tdata"><asp:Label ID="TMRRegionLabel" runat="server" Text='<%# Bind("TMRRegion") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Memory:</td>
<td class="Tdata"><asp:Label ID="Label6" runat="server" Text='<%# Bind("Memory") %>'></asp:Label></td>
<td class="Theader">ICM:</td>
<td class="Tdata"><asp:TextBox ID="ICMTextBox" runat="server" Text='<%# Bind("ICM") %>' /></td>
</tr>
<tr>
<td class="Theader">Processor Type:</td>
<td class="Tdata"><asp:Label ID="Label8" runat="server" Text='<%# Bind("ProcessorType") %>'></asp:Label></td>
<td class="Theader">CAB:</td>
<td class="Tdata"><asp:TextBox ID="CABTextBox" runat="server" Text='<%# Bind("CAB") %>'></asp:TextBox></td>
</tr>
<tr>
<td class="Theader">Processor Speed:</td>
<td class="Tdata"><asp:Label ID="Label10" runat="server" Text='<%# Bind("ProcessorSpeed") %>'></asp:Label></td>
<td class="Theader">Keyword:</td>
<td class="Tdata"><asp:TextBox ID="KeywordsTextBox" runat="server" Text='<%# Bind("Keywords") %>'></asp:TextBox></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton></td>
<td><asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /></td>
</tr>
</table>
</InsertItemTemplate>
<ItemTemplate>
<table class="formdata" cellpadding="2" cellspacing="0">
<tr>
<td class="Theader">Machine ID:</td>
<td class="Tdata"><asp:Label ID="MachineIdLabel1" runat="server" Text='<%# Eval("MachineId") %>'></asp:Label></td>
<td class="Theader">Physical Processor Count:</td>
<td class="Tdata"><asp:Label ID="PhysProcessorCntLabel" runat="server" Text='<%# Bind("PhysProcessorCnt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Serial Number:</td>
<td class="Tdata"><asp:Label ID="SerialNmbrLabel" runat="server" Text='<%# Bind("SerialNmbr") %>'></asp:Label></td>
<td class="Theader">Total DASD:</td>
<td class="Tdata"><asp:Label ID="TotalDasdLabel" runat="server" Text='<%# Bind("TotalDasd") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Windows Domain Name:</td>
<td class="Tdata"><asp:Label ID="WindowsDomainNmLabel" runat="server" Text='<%# Bind("WindowsDomainNm") %>'></asp:Label></td>
<td class="Theader">OS Name:</td>
<td class="Tdata"><asp:Label ID="OsNmLabel" runat="server" Text='<%# Bind("OsNm") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">DNS Domain Name:</td>
<td class="Tdata"><asp:Label ID="DnsDomainNmLabel" runat="server" Text='<%# Bind("DnsDomainNm") %>'></asp:Label></td>
<td class="Theader">OS Version:</td>
<td class="Tdata"><asp:Label ID="OsVersionLabel" runat="server" Text='<%# Bind("OsVersion") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Environment:</td>
<td class="Tdata"><asp:Label ID="EnvironmentNmLabel" runat="server" Text='<%# Bind("EnvironmentNm") %>'></asp:Label></td>
<td class="Theader">Created Date:</td>
<td class="Tdata"><asp:Label ID="CreateDtLabel" runat="server" Text='<%# Bind("CreateDt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Mailcode:</td>
<td class="Tdata"><asp:Label ID="MailcodeLabel" runat="server" Text='<%# Bind("Mailcode") %>'></asp:Label></td>
<td class="Theader">Inactive Indicator:</td>
<td class="Tdata"><asp:CheckBox ID="InactiveInCheckBox" Enabled="false" runat="server" Checked='<%# Bind("InactiveIn") %>' BorderStyle="none" /></td>
</tr>
<tr>
<td class="Theader">Vendor:</td>
<td class="Tdata"><asp:Label ID="Label2" runat="server" Text='<%# Bind("VendorNm") %>'></asp:Label></td>
<td class="Theader">Inactivated Date:</td>
<td class="Tdata"><asp:Label ID="InactiveDtTextBox" runat="server" Text='<%# Bind("InactiveDt") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Model:</td>
<td class="Tdata"><asp:Label ID="Label4" runat="server" Text='<%# Bind("Model") %>'></asp:Label></td>
<td class="Theader">TMR Region:</td>
<td class="Tdata"><asp:Label ID="TMRRegionLabel" runat="server" Text='<%# Bind("TMRRegion") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Memory:</td>
<td class="Tdata"><asp:Label ID="Label6" runat="server" Text='<%# Bind("Memory") %>'></asp:Label></td>
<td class="Theader">ICM:</td>
<td class="Tdata"><asp:Label ID="ICMLabel" runat="server" Text='<%# Bind("ICM") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Processor Type:</td>
<td class="Tdata"><asp:Label ID="Label8" runat="server" Text='<%# Bind("ProcessorType") %>'></asp:Label></td>
<td class="Theader">CAB:</td>
<td class="Tdata"><asp:Label ID="CABLabel" runat="server" Text='<%# Bind("CAB") %>'></asp:Label></td>
</tr>
<tr>
<td class="Theader">Processor Speed:</td>
<td class="Tdata"><asp:Label ID="Label10" runat="server" Text='<%# Bind("ProcessorSpeed") %>'></asp:Label></td>
<td class="Theader">Keyword:</td>
<td class="Tdata"><asp:Label ID="KeywordsLabel" runat="server" Text='<%# Bind("Keywords") %>'></asp:Label></td>
</tr>
<tr>
<td colspan="4" align="right"><asp:Button ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" CssClass="RegularButton"></asp:Button>
</tr>
</table>
</ItemTemplate>
</asp:FormView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table> <br />
</td>
</tr>
<tr>
<td valign="top">
<table class="formdata" cellpadding="2px" style="height:100%" cellspacing="2px">
<tr>
<td valign="top">
<asp:UpdatePanel ID="UpdatePanel4" UpdateMode="conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GVInstances" runat="server" AllowPaging="True" PageSize="5" DataSourceID="ODSInstance" AutoGenerateColumns="False">
<EmptyDataTemplate>
No Data to Display
</EmptyDataTemplate>
<Columns>
<asp:TemplateField HeaderText="AIT Number">
<ItemTemplate>
<asp:Label ID="lblaitnmbr" runat="server" Text='<%# Bind("Aitnmbr") %>' Width="100px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Application Name">
<ItemTemplate>
<asp:Label ID="lblapplicationshortnm" runat="server" Text='<%# Bind("ApplicationShortNm") %>' Width="100px"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Instance Name">
<ItemTemplate>
<asp:Label ID="lblInstanceNm" runat="server" Width="100px" Text='<%# Bind("InstanceNm") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Product Name">
<ItemTemplate>
<asp:Label ID="lblProductNm" Width="100px" runat="server" Text='<%# Bind("ProductNm") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Version Number">
<ItemTemplate>
<asp:Label ID="lblVersionNo" Width="70px" runat="server" Text='<%# Bind("VersionNo") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Physical DBName">
<ItemTemplate>
<asp:Label ID="lblPhysDatabaseNm" Width="100px" runat="server" Text='<%# Bind("PhysDatabaseNm") %>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<llblgenpro:LLBLGenProDataSource2 ID="ODSMachineDetail" runat="server" AdapterTypeName="ENVWeb.DAL.DatabaseSpecific.DataAccessAdapter, ENVWeb.DALDBSpecific" DataContainerType="EntityCollection" EntityFactoryTypeName="ENVWeb.DAL.FactoryClasses.MachineEntityFactory, ENVWeb.DAL" EnablePaging="false">
<SelectParameters>
<asp:ControlParameter ControlID="GVMachineViewList" DefaultValue="" Name="MachineId" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</llblgenpro:LLBLGenProDataSource2>
<llblgenpro:LLBLGenProDataSource2 ID="ODSInstance" runat="server" AdapterTypeName="ENVWeb.DAL.DatabaseSpecific.DataAccessAdapter, ENVWeb.DALDBSpecific" DataContainerType="EntityCollection" EntityFactoryTypeName="ENVWeb.DAL.FactoryClasses.VDbsBymachineEntityFactory, ENVWeb.DAL" >
<SelectParameters>
<asp:ControlParameter ControlID="GVMachineViewList" Name="MachineId" PropertyName="SelectedValue" Type="String"/>
</SelectParameters>
</llblgenpro:LLBLGenProDataSource2>
<llblgenpro:LLBLGenProDataSource2 ID="ODSEnvir" AllowDuplicates="False"
runat="server"
AdapterTypeName="ENVWeb.DAL.DatabaseSpecific.DataAccessAdapter, ENVWeb.DALDBSpecific"
DataContainerType="EntityCollection"
EntityFactoryTypeName="ENVWeb.DAL.FactoryClasses.EnvironmentEntityFactory, ENVWeb.DAL" >
</llblgenpro:LLBLGenProDataSource2>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel> <asp:UpdateProgress ID="UPGMachineView" runat="server" AssociatedUpdatePanelID="UPMachineView"> <ProgressTemplate> <img src="images/progress.gif" alt="Update in Progress, please wait..."/> </ProgressTemplate> </asp:UpdateProgress>
please help.
Joined: 29-Nov-2008
sorry ascxpage was copied wrong :
here it is :
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AssignInstsDbsSchemas.ascx.cs" Inherits="ENVWeb.AssignInstsDbsSchemas" %> <%@ Register Assembly="SD.LLBLGen.Pro.ORMSupportClasses.NET20" Namespace="SD.LLBLGen.Pro.ORMSupportClasses" TagPrefix="llblgenpro" %> <asp:ScriptManagerProxy ID="SMP" runat="server"></asp:ScriptManagerProxy> <link id="Link1" href="Master.css" rel="stylesheet" runat="server" type="text/css" /> <asp:UpdatePanel ID="UPMachineView" UpdateMode="conditional" runat="server"> <ContentTemplate> <table> <tr> <td rowspan="2" valign="top"> <table style="width:100%;"> <tr> <td> <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="conditional" runat="server"> <ContentTemplate> <asp:GridView ID="GVMachineViewList" runat="server" AllowPaging="True" PageSize="15" OnPageIndexChanging="GVMachineViewList_PageIndexChanging" AutoGenerateColumns="False" DataKeyNames="MachineId" EnableViewState ="true" DataMember="DefaultView" ondatabound="GVMachineViewList_DataBound"> <Columns> <asp:TemplateField> <HeaderStyle Wrap="false" /> <HeaderTemplate> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="/Images/remove-item-red.gif" CausesValidation="true" OnClick="GVMachineViewList_ClearFilter"/> </HeaderTemplate> <ItemStyle Wrap="false" /> <ItemTemplate> <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="/Images/select-item-red.gif" CommandName="Select"/> </ItemTemplate> </asp:TemplateField>
<asp:TemplateField>
<HeaderStyle Wrap="false" />
<HeaderTemplate>
<asp:Literal runat="server" ID="LITMachineId" Text="Machine ID" />
<br />
<asp:TextBox ID="TBMachineId" runat="server" AutoPostBack="True" OnTextChanged="GVMachineViewList_TextChanged" Columns="10" CssClass="textbox" />
</HeaderTemplate>
<ItemTemplate>
<asp:Literal runat="server" ID="LMachineId" Text='<%# Eval("MachineId") %>' ></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Literal ID="lblOsNm" runat="server" Text="OS Name"></asp:Literal>
<br />
<asp:TextBox ID="TBOsNm" runat="server" AutoPostBack="True" OnTextChanged="GVMachineViewList_TextChanged" Columns="10" CssClass="textbox" />
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LOsNm" runat="server" Text='<%# Eval("OsNm") %>'> </asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate><asp:Label ID="Label1" runat="server" Text="Machine </br>Indicator"></asp:Label></HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LInactiveIn" runat="server" Text='<%# Eval("InactiveIn").ToString().Substring(0,1) %>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label ID="lblGVMachineViewList" runat="server"></asp:Label>
</td>
</tr>
</table>
</td>
<tr>
<td valign="top">
<table class="formdata" cellpadding="2px" style="height:100%" cellspacing="2px">
<tr>
<td valign="top">
<asp:UpdatePanel ID="UpdatePanel4" UpdateMode="conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GVInstances" runat="server" AllowPaging="True" PageSize="5" DataSourceID="ODSInstance" AutoGenerateColumns="False">
<EmptyDataTemplate>
No Data to Display
</EmptyDataTemplate>
<Columns>
<asp:TemplateField HeaderText="AIT Number">
<ItemTemplate>
<asp:Label ID="lblaitnmbr" runat="server" Text='<%# Bind("Aitnmbr") %>' Width="100px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Application Name">
<ItemTemplate>
<asp:Label ID="lblapplicationshortnm" runat="server" Text='<%# Bind("ApplicationShortNm") %>' Width="100px"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Instance Name">
<ItemTemplate>
<asp:Label ID="lblInstanceNm" runat="server" Width="100px" Text='<%# Bind("InstanceNm") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Product Name">
<ItemTemplate>
<asp:Label ID="lblProductNm" Width="100px" runat="server" Text='<%# Bind("ProductNm") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Version Number">
<ItemTemplate>
<asp:Label ID="lblVersionNo" Width="70px" runat="server" Text='<%# Bind("VersionNo") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Physical DBName">
<ItemTemplate>
<asp:Label ID="lblPhysDatabaseNm" Width="100px" runat="server" Text='<%# Bind("PhysDatabaseNm") %>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<llblgenpro:LLBLGenProDataSource2 ID="ODSMachineDetail" runat="server" AdapterTypeName="ENVWeb.DAL.DatabaseSpecific.DataAccessAdapter, ENVWeb.DALDBSpecific" DataContainerType="EntityCollection" EntityFactoryTypeName="ENVWeb.DAL.FactoryClasses.MachineEntityFactory, ENVWeb.DAL" EnablePaging="false">
<SelectParameters>
<asp:ControlParameter ControlID="GVMachineViewList" DefaultValue="" Name="MachineId" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</llblgenpro:LLBLGenProDataSource2>
<llblgenpro:LLBLGenProDataSource2 ID="ODSInstance" runat="server" AdapterTypeName="ENVWeb.DAL.DatabaseSpecific.DataAccessAdapter, ENVWeb.DALDBSpecific" DataContainerType="EntityCollection" EntityFactoryTypeName="ENVWeb.DAL.FactoryClasses.VDbsBymachineEntityFactory, ENVWeb.DAL" >
<SelectParameters>
<asp:ControlParameter ControlID="GVMachineViewList" Name="MachineId" PropertyName="SelectedValue" Type="String"/>
</SelectParameters>
</llblgenpro:LLBLGenProDataSource2>
<llblgenpro:LLBLGenProDataSource2 ID="ODSEnvir" AllowDuplicates="False"
runat="server"
AdapterTypeName="ENVWeb.DAL.DatabaseSpecific.DataAccessAdapter, ENVWeb.DALDBSpecific"
DataContainerType="EntityCollection"
EntityFactoryTypeName="ENVWeb.DAL.FactoryClasses.EnvironmentEntityFactory, ENVWeb.DAL" >
</llblgenpro:LLBLGenProDataSource2>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel> <asp:UpdateProgress ID="UPGMachineView" runat="server" AssociatedUpdatePanelID="UPMachineView"> <ProgressTemplate> <img src="images/progress.gif" alt="Update in Progress, please wait..."/> </ProgressTemplate> </asp:UpdateProgress>
Next time, please attach your code instead of pasting it inline.
Would you please try the following code:
protected void GVListBind(int pagenum, int pagesize)
{
using (DataAccessAdapter mAdaptersecond = new DataAccessAdapter(true))
{
mAdaptersecond.FetchTypedList(fields, mList, Filter, 0, null, false, group, 0, 0);
if (mList.Count == 0)
{
Filter.PredicateExpression.Clear();
mAdaptersecond.FetchTypedList(fields, mList, Filter, 0, null, false, group, 0, 0);
}
ViewState["Gridinfo"] = mList;
mList = (MachineTypedList)ViewState["Gridinfo"];
GVMachineViewList.DataSource = mList;
GVMachineViewList.AutoGenerateColumns = false;
GVMachineViewList.PageIndex = pagenum;
GVMachineViewList.DataBind();
mAdaptersecond.CloseConnection();
}
}