Problem: Store Images in a Sql Database

Last post 06-21-2007, 9:42 AM by Adam. 3 replies.
Sort Posts: Previous Next
  •  10-26-2005, 5:39 AM 12012

    Problem: Store Images in a Sql Database

    Hi
     
    I want to save the images (gallery) into a Sql Database.
    so I installed the sample 'CustomFileProvider' in VS.Net 2005.
    When I click on 'Image gallery'-Button there is the following exception (see below for the Stack Trace):
    [SqlException (0x80131904): Timeout expired.  

    I created before a new db:
    1. create database "test"  
    2. apply: fsitems.sql
    3. create the user 'test', with password 'test' assigned to the database test
    4. set in SqlFileStorage.cs the connection string:
      public static string ConnectionString = @".;uid=test;pwd=test;Trusted_Connection=no;database=test";

    What's the problem?
    - invalid connection string
    - CustomFileProvider.dll is not .Net 2.0 compatible
    - where can I set the provider?
         <connectionStrings>
              <add name="clx.net.framework" connectionString="Data Source=.;Integrated Security=SSPI;Initial Catalog=test;" providerName="System.Data.SqlClient" />
         </connectionStrings>

    Thanks and Regards,
    Björn.


    Stack Trace
    ========
     [SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]                                                         
        System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +118
        System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +345
        System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean integr
        System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +979
        System.Data.SqlClient.SqlInternalConnectionTds..ctor(SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +258
        System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +627
        System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +81
        System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +567
        System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +126
        System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +502
        System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +159
        System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122                                                      
        System.Data.SqlClient.SqlConnection.Open() +230
        CustomFileProvider.SqlSample.SqlFileStorage.EnterQuery() +65
        CustomFileProvider.SqlSample.SqlFileStorage.GetDirectoryItems(String dirpath, Boolean getcount) +155
        CuteEditor.Dialogs.InsertGalleryFrame.b() +811
        CuteEditor.Dialogs.InsertGalleryFrame.OnLoad(EventArgs e) +36
        System.Web.UI.Control.LoadRecursive() +74
        System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3068
     
  •  10-26-2005, 7:42 AM 12016 in reply to 12012

    Re: Problem: Store Images in a Sql Database

    Hi
     
    I fixed the problem: it was the invalid connection string!
     
    Solution:
    set in the Page_Load from the sample 'UseSql.aspx' the correct connection string,
    otherwise its using the default one defined in SqlFileStorage.cs!
     
     private void Page_Load(object sender, System.EventArgs e)
     {
      // set the connection string
      CustomFileProvider.SqlSample.SqlFileStorage.ConnectionString = @"server=.;uid=test;pwd=test;Trusted_Connection=no;database=test";
      Editor1.Setting["CuteEditorFileStorageType"]=typeof(SqlFileStorage).AssemblyQualifiedName;
      Editor1.Setting["DownFile"]=ResolveUrl("DownFile.Aspx");
      Editor1.SetSecurityGalleryPath("/");
     }
    Björn.
  •  06-20-2007, 11:10 PM 30939 in reply to 12016

    Re: Problem: Store Images in a Sql Database

     
     
    Hello
     
     
    Im using CuteEditor 6.0 . Im storing the images as binary data in some database. how can i display these images in the cute editor.
    Please help me ,
     
    Thanking In Advance
    Ani Gopal
  •  06-21-2007, 9:42 AM 30952 in reply to 30939

    Re: Problem: Store Images in a Sql Database

    Ani Gopal,
     
    Please check the following examples:
     

     
    Hope it helps. Let me know if you have any further questions.
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML