OpenAccessException

Posted by Community Admin on 03-Aug-2018 14:01

OpenAccessException

All Replies

Posted by Community Admin on 12-May-2010 00:00

Hi,

When I try to create a new Sitefinity 4.0 application I get the following error:
OpenAccessException:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)


I know that the IP settings are setup correctly already because we create Sitefinity 3.7 projects in the same way. I noticed that after I created the project using the CTP exe application the web.config file didn't have any connection strings which I assume is being created when you access the site for the first time, but I can't get past this point.

Any idea what could be wrong?

PS. Windows XP Professional, IIS 5.1, SQL Server 2005 Express

Regards,
Jacques

Posted by Community Admin on 12-May-2010 00:00

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

  • run CMD
  • netstat -ano| findstr 1433
  • telnet SERVERNAME 1433
  • ping -a SERVERNAME
You could test the connection by using simple control that is shown below

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";


Greetings,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Posted by Community Admin on 13-May-2010 00:00

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.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)


I also mentioned in my previous post that we already have Sitefinity 3.7 projects setup on the same server and running it from my local machine is no problem at all, so the SQL configuration shouldn't be the problem.

What else could be wrong?

Regards,
Jacques

Posted by Community Admin on 13-May-2010 00:00

Hello J.Hoventer,

You could take a look at


There are not problems establishing the connection to a remote machine at our end. Since we are using Telerik Open Access as our ORM for the data layer establishing a connection with a database is handled by the ORM. OpenAccess has been tested and working without problems with remote connections.
Make sure that

  • Named Pipes and TCP/IP protocols for SQL server are enabled
  • SQL Server Browser is enabled

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Posted by Community Admin on 13-May-2010 00:00

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

Posted by Community Admin on 13-May-2010 00:00

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


Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Posted by Community Admin on 30-Jun-2010 00:00

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

Posted by Community Admin on 30-Jun-2010 00:00

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

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 30-Jun-2010 00:00

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....

Posted by Community Admin on 30-Jun-2010 00:00

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

Posted by Community Admin on 30-Jun-2010 00:00

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.

Posted by Community Admin on 30-Jun-2010 00:00

Hello sir,

And more Doubt.. we have to do all Database Operation in Asp.Net Environment only.. is it right sir...

Thank you...

Posted by Community Admin on 30-Jun-2010 00:00

Hi jagadish kumar,

You could take a look at Sitefinity 4.0 CTP - Controls Overview

Regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 30-Jun-2010 00:00

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...

Posted by Community Admin on 30-Jun-2010 00:00

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

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 30-Jun-2010 00:00

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............

Posted by Community Admin on 30-Jun-2010 00:00

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

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 30-Jun-2010 00:00

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

   "

Posted by Community Admin on 01-Jul-2010 00:00

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..................

Posted by Community Admin on 01-Jul-2010 00:00

Hello jagadish kumar,

1) make sure RadComboBoxProduct_ItemsRequested is defined in code behind
2) make sure it's at least "protected"
3) make sure that the signature of the method is correct  - object o, RadComboBoxItemsRequestedEventArgs e

The problem is in your control, it does not come from Sitefinity or LINQ. I attached  a sample video that shows RadGrid control bound to LINQ -SQL datasource.

<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>



Best wishes,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed