Problem: Store Images in a Sql Database

  •  10-26-2005, 5:39 AM

    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
     
View Complete Thread