OpenAccessException
Hi,
When I try to create a new Sitefinity 4.0 application I get the following error:
OpenAccessException:
Hello J.Hoventer,
The problem is related to SQL server. The error says that the SQL server you use cannot be reached. Generally if you use Sitefinity's installer it should create a SQL Express database automatically or database under you SQL server. By default SQL server runs under 1433 port so make sure that it has not been changed. If you are performing remote connection, make sure your database engine is configured to accept the remote connections. Check the SQL Server service account. ASP.NET process uses NETWORK SERVICE account. Check whether you have a security software has blocked the connection. You can also check the SQL server connectivity
protected
void
Page_Load(
object
sender, EventArgs e)
string
connectionString = GetConnectionString();
using
(SqlConnection connection =
new
SqlConnection())
connection.ConnectionString = connectionString;
connection.Open();
static
private
string
GetConnectionString()
return
" YOUR CONNECTION STRING GOES HERE"
;
Hi Ivan,
I tried creating a control to connect to the database and it worked fine. So I retried the connection with Sitefinity, but I still get the same error.
Hello J.Hoventer,
You could take a look at
I managed to get this fixed by checking the specific port in use on the server.
What is strange about this is that it's never been an issue before. Am I right in assuming that these settings are no longer being stored in the web.config file and that where ever it is now being stored 'explicitly' uses a port number?
Regards,
Jacques
Hi J.Hoventer,
There is a DataConfig file where the connection string is saved - App_Data\Sitefinity\Configuration\DataConfig.config
Sincerely yours,
Ivan Dimitrov
the Telerik team
Hello sir,
i have a major problem in data access from the database because till now i haven't got an idea, how to do that..
So please guide me completely how to do the data access from the access in the sitefinity just from the beginning...
I hope your reply as soon as possible...
Thank you..
Jagadish
Hello jagadish kumar,
Could you elaborate some more about the issue you have and what do you mean by "how to do the data access from the access in the sitefinity"
Sincerely yours,
Ivan Dimitrov
the Telerik team
Hello sir,
Thanks for your great response as reply..
i am the newbie in the sitefinity cms with asp.net and i need to do fetch some data from the database. for example i need to create a treeview and it gets the node as data from the database in run time. so i need to know,
how to connect or configure a database
how to fetch a data from the database
how to use rad controls in my site
So Eventually i need your complete guidance about these issues.
Thank you....
Hi Jagadish,
Sitefinity is an Asp.net application like just about any other Asp.net application so accessing data is the same as it would be for any other application: Data Providers, Connections, Adapters etc. On top of that you can make use of the documented API that comes with Sitefinity. If you're looking to add functionality to Sitefinity then I suggest you start reading up on Sitefinity's use of normal User Controls for basic functionality and then modules for more complex functionality.
Regards,
Jacques
Hello sir,
Thank you very much...
How to use rad controls in my site... because am using evaluation mode... so only i asked you sir.
Hello sir,
And more Doubt.. we have to do all Database Operation in Asp.Net Environment only.. is it right sir...
Thank you...
Hi jagadish kumar,
You could take a look at Sitefinity 4.0 CTP - Controls Overview
Regards,
Ivan Dimitrov
the Telerik team
Hello sir,
i have one more doubt sir.. i got an error when i put the control in the layout i mean drag & drop the control into the layout.
it is "Exception of type 'System.Web.HttpUnhandledException' was thrown."
Please help me sir...
Hi jagadish kumar,
Please provide the steps you have followed to reproduce the issue. Please tell us which version of Sitefinity you use, because this tread is for Sitefinity 4.0 CTP edition.
Regards,
Ivan Dimitrov
the Telerik team
Hello sir,
i have used Sitefinity 4.0 CTP edition. i just done the following steps.
i have developed i mean create one radgrid and assigned the LINQ datasource after that i went to the sitefinity environment , upoload it and used it...
when i drag and drop the control into layout it said "Exception of type 'System.Web.HttpUnhandledException' was thrown."
so wat i have to do ... It's Very urgent so PLease help me soon............
Hello jagadish kumar,
HttpUnhandledException is thrown when a generic exception occurs. Could you provide some more details about the code you use so we could try to replicate the issue and see whether there is a bug in our code or not.
Kind regards,
Ivan Dimitrov
the Telerik team
Hello sir,
i created one control in asp.net named as Sample.ascx... inside of the control i defined rad grid control with the rad script manager and used LINQ Datasoruce control...
the actual coding is given below sir,
<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" CodeFile="Sample.ascx.cs" Inherits="User_Controls_Sample" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataSourceID="LinqDataSource1" GridLines="None" Skin="WebBlue"
AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
AllowAutomaticUpdates="True" PageSize="5" Width="31%"
AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"
onneeddatasource="RadGrid1_NeedDataSource" ShowGroupPanel="True"
>
<HeaderContextMenu EnableAutoScroll="True"></HeaderContextMenu>
<MasterTableView datasourceid="LinqDataSource1">
<Columns>
<telerik:GridBoundColumn DataField="Title1"
HeaderText="Title1" ReadOnly="True" SortExpression="Title1"
UniqueName="Title1">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Keywords" HeaderText="Keywords"
SortExpression="Keywords" UniqueName="Keywords" ReadOnly="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Description"
HeaderText="Description" SortExpression="Description" UniqueName="Description"
ReadOnly="True">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<clientsettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"
AllowDragToGroup="True">
<selecting allowrowselect="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</clientsettings>
<FilterMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
</telerik:RadGrid>
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="TestDataContext" Select="new (Title1, Keywords, Description)"
TableName="Titles" EnableDelete="True" EnableInsert="True"
EnableUpdate="True">
</asp:LinqDataSource>
After that i moved to sitefinity and upload the control and used it... in the time of using i mean i have put the control into the panel.. it said that exception error......
SO wat i hav to do..............
And mainly i got this error whenever i tried to put some controls........
"An exception of type 'System.Web.HttpCompileException' occurred and was caught.
-------------------------------------------------------------------------------
06/30/2010 18:31:29
Type : System.Web.HttpCompileException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Message : f:\Current\Projects\Test\User_Controls\Combo.ascx(3): error CS1061: 'ASP.user_controls_combo_ascx' does not contain a definition for 'RadComboBoxProduct_ItemsRequested' and no extension method 'RadComboBoxProduct_ItemsRequested' accepting a first argument of type 'ASP.user_controls_combo_ascx' could be found (are you missing a using directive or an assembly reference?)
Source : System.Web
Help link :
Results : System.CodeDom.Compiler.CompilerResults
SourceCode : #pragma checksum "F:\Current\Projects\Test\User_Controls\Combo.ascx" "406ea660-64cf-4c82-b6f0-42d48172a799" "A3D51586F94D5E8E5B06F5DAD5EF740B"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4036
//// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class User_Controls_Combo
#line 3 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
protected global::Telerik.Web.UI.RadComboBox RadComboBoxProduct;
#line default
#line hidden
protected System.Web.Profile.DefaultProfile Profile
get
return ((System.Web.Profile.DefaultProfile)(this.Context.Profile));
protected System.Web.HttpApplication ApplicationInstance
get
return ((System.Web.HttpApplication)(this.Context.ApplicationInstance));
namespace ASP
#line 284 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web.Security;
#line default
#line hidden
#line 281 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web;
#line default
#line hidden
#line 283 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web.SessionState;
#line default
#line hidden
#line 2 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
using Telerik.Web.UI;
#line default
#line hidden
#line 279 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Text;
#line default
#line hidden
#line 287 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web.UI.WebControls;
#line default
#line hidden
#line 285 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web.Profile;
#line default
#line hidden
#line 276 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Collections;
#line default
#line hidden
#line 288 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web.UI.WebControls.WebParts;
#line default
#line hidden
#line 278 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Configuration;
#line default
#line hidden
#line 275 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System;
#line default
#line hidden
#line 282 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web.Caching;
#line default
#line hidden
#line 286 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web.UI;
#line default
#line hidden
#line 277 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Collections.Specialized;
#line default
#line hidden
#line 280 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Text.RegularExpressions;
#line default
#line hidden
#line 289 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
using System.Web.UI.HtmlControls;
#line default
#line hidden
[System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
public class user_controls_combo_ascx : global::User_Controls_Combo
private static bool @__initialized;
private static object @__stringResource;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public user_controls_combo_ascx()
#line 912304 "F:\Current\Projects\Test\User_Controls\Combo.ascx.cs"
((global::System.Web.UI.UserControl)(this)).AppRelativeVirtualPath = "~/User_Controls/Combo.ascx";
#line default
#line hidden
if ((global::ASP.user_controls_combo_ascx.@__initialized == false))
global::ASP.user_controls_combo_ascx.@__stringResource = this.ReadStringResource();
global::ASP.user_controls_combo_ascx.@__initialized = true;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void @__BuildControl__control2(System.Web.UI.Control @__ctrl)
System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
#line 3 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
@__parser.AddParsedSubObject(this.CreateResourceBasedLiteralControl(0, 631, true));
#line default
#line hidden
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.DataBoundLiteralControl @__BuildControl__control4()
global::System.Web.UI.DataBoundLiteralControl @__ctrl;
#line 24 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
@__ctrl = new global::System.Web.UI.DataBoundLiteralControl(4, 3);
#line default
#line hidden
@__ctrl.TemplateControl = this;
@__ctrl.SetStaticString(0, "\r\n <table style=\"width: 275px\" cellspacing=\"0\" cel" +
"lpadding=\"0\">\r\n <tr>\r\n " +
" <td style=\"width: 177px;\">\r\n " +
" ");
@__ctrl.SetStaticString(1, "\r\n </td>\r\n " +
" <td style=\"width: 60px;\">\r\n ");
@__ctrl.SetStaticString(2, "\r\n </td>\r\n " +
" <td style=\"width: 40px;\">\r\n ");
@__ctrl.SetStaticString(3, "\r\n </td>\r\n " +
" </tr>\r\n </table>\r\n " +
" ");
#line 24 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
@__ctrl.DataBinding += new System.EventHandler(this.@__DataBind__control4);
#line default
#line hidden
return @__ctrl;
public void @__DataBind__control4(object sender, System.EventArgs e)
Telerik.Web.UI.RadComboBoxItem Container;
System.Web.UI.DataBoundLiteralControl target;
#line 24 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
target = ((System.Web.UI.DataBoundLiteralControl)(sender));
#line default
#line hidden
#line 24 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
Container = ((Telerik.Web.UI.RadComboBoxItem)(target.BindingContainer));
#line default
#line hidden
#line 24 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
target.SetDataBoundString(0, System.Convert.ToString(DataBinder.Eval(Container, "Text"), System.Globalization.CultureInfo.CurrentCulture));
#line default
#line hidden
#line 27 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
target.SetDataBoundString(1, System.Convert.ToString(DataBinder.Eval(Container, "Attributes['UnitsInStock']"), System.Globalization.CultureInfo.CurrentCulture));
#line default
#line hidden
#line 30 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
target.SetDataBoundString(2, System.Convert.ToString(DataBinder.Eval(Container, "Attributes['UnitPrice']"), System.Globalization.CultureInfo.CurrentCulture));
#line default
#line hidden
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void @__BuildControl__control3(System.Web.UI.Control @__ctrl)
global::System.Web.UI.DataBoundLiteralControl @__ctrl1;
#line 3 "F:\Current\Projects\Test\User_Controls\Combo.ascx"
@__ctrl1 = this.@__BuildControl__control4();
#line default
"
Hello sir..
i have a major problem when i put some controls into layout .. it says "Exception of type 'System.Web.HttpUnhandledException' was thrown"
what i have to do...
tell me please ........ sooon..........
it's very urgent..................
Hello jagadish kumar,
<
telerik:RadGrid
runat
=
"server"
ID
=
"RadGrid1"
DataSourceID
=
"LinqDataSource1"
GridLines
=
"None"
Skin
=
"WebBlue"
>
<
HeaderContextMenu
EnableAutoScroll
=
"True"
></
HeaderContextMenu
>
<
MasterTableView
datasourceid
=
"LinqDataSource1"
AutoGenerateColumns
=
"false"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Name"
HeaderText
=
"Name"
SortExpression
=
"Name"
UniqueName
=
"Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ItemType"
HeaderText
=
"ItemType"
SortExpression
=
"ItemType"
UniqueName
=
"ItemType"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
clientsettings
AllowColumnsReorder
=
"True"
ReorderColumnsOnClient
=
"True"
AllowDragToGroup
=
"True"
>
<
selecting
allowrowselect
=
"True"
/>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
</
clientsettings
>
<
FilterMenu
EnableTheming
=
"True"
>
<
CollapseAnimation
Type
=
"OutQuint"
Duration
=
"200"
></
CollapseAnimation
>
</
FilterMenu
>
</
telerik:RadGrid
>
<
asp:LinqDataSource
ID
=
"LinqDataSource1"
runat
=
"server"
ContextTypeName
=
"RadGridLinqSqlDataContext"
Select
=
"new (Name, ItemType)"
TableName
=
"sf_PageBases"
EnableDelete
=
"True"
EnableInsert
=
"True"
EnableUpdate
=
"True"
>
</
asp:LinqDataSource
>