Assisted Solutions Forums

Welcome! These forums provide help and documentation for our products and services.
Welcome to Assisted Solutions Forums Sign in | Join | Help
in Search

SlickUpload w/SQL Server 2005

Last post 05-14-2008, 11:43 AM by MikeBeis. 9 replies.
Sort Posts: Previous Next
  •  05-06-2008, 3:25 PM 4038

    SlickUpload w/SQL Server 2005

    Does anyone have a working example of SlickUpload used with a SQL Server, including data table definition? I am not having any luck setting this up at all.
  •  05-06-2008, 5:25 PM 4039 in reply to 4038

    Re: SlickUpload w/SQL Server 2005

    Are you trying to use SQL Server to store files? Or to support uploading with progress on a clustered/webfarm environment?
  •  05-09-2008, 8:16 AM 4042 in reply to 4039

    Re: SlickUpload w/SQL Server 2005

    I am uploading to a SQL Server 2005. Right now my problem is thatI get the upload window, submit files and the progress panel gets stuck on calculating. Don't know where to go from here.

     

  •  05-12-2008, 8:53 AM 4044 in reply to 4039

    Re: SlickUpload w/SQL Server 2005

    I got the progressbar issue fixed. Now I am having problems finding out how to identify the records when the upload is complete. Whe there is an uploadID, why in the world is that not written to the SQL table? How do you identify the FileID's upon completion of the download?

    Please help! Issues with the SlickUpload is holding an entire project back right now. 

  •  05-13-2008, 9:10 AM 4045 in reply to 4044

    Re: SlickUpload w/SQL Server 2005

    Index into the file's LocationInfo dictionary like so:

    string criteria = file.LocationInfo[SqlClientUploadStreamProvider.WhereCriteriaKey];

    That will return the where clause used for the record. If you're using the Identity criteria method, you can pull out just the identity ID created like so:

    string id = file.LocationInfo[SqlClientUploadStreamProvider.IdentityIdKey];
  •  05-13-2008, 8:20 PM 4048 in reply to 4045

    Re: SlickUpload w/SQL Server 2005

    I must be completely missing something. Where do you insert those statements?
  •  05-13-2008, 10:31 PM 4049 in reply to 4048

    Re: SlickUpload w/SQL Server 2005

    You're using the UploadManager control, right? Add the statements inside the UploadComplete event. You should call e.Status.GetUploadedFiles() to get a list of files (UploadedFile instances) that were uploaded. Then for each UploadedFile (the file reference above), you can call that snippet to get the id.

    For example:

    protected void uploadManager_UploadComplete(object sender, UploadStatusEventArgs e)
    {
       foreach (UploadedFile file in e.Status.GetUploadedFiles())
          {
             
    string id = file.LocationInfo[SqlClientUploadStreamProvider.IdentityIdKey];

             // do something with the id
          }
    }

  •  05-13-2008, 11:05 PM 4050 in reply to 4045

    Re: SlickUpload w/SQL Server 2005

    Protected Sub uploadManager_UploadComplete(ByVal sender As Object, ByVal e As Krystalware.SlickUpload.Controls.UploadStatusEventArgs) Handles UploadManager.UploadComplete

    uploadPanel.Visible = False

    Dim Status As UploadStatus = e.Status

    If e.Status.Reason = UploadTerminationReason.NotTerminated Then

    For Each File As Object In Status.GetUploadedFiles()

    MsgBox(File.Locationinfo(???????))      <---------WHAT GOES HERE?  SqlClientUploadStreamProvider is not declared.

    Next

    resultsMessage.InnerText = "Upload was successful. You may close this window now."

    Else

    If e.Status.Reason = UploadTerminationReason.Disconnected Then

    resultsMessage.InnerText = "Upload was cancelled."

    Else

    resultsMessage.InnerHtml = "Upload resulted in an error.<br />Reason:" + e.Status.Reason.ToString() + "<br />Message:" + _

    e.Status.ErrorMessage

    End If

    resultsMessage.Style("color") = "red"

    End If

    End Sub

  •  05-13-2008, 11:33 PM 4051 in reply to 4050

    Re: SlickUpload w/SQL Server 2005

    Change the for loop to read:

    For Each file As UploadedFile In Status.GetUploadedFiles()
       Dim id As String = file.LocationInfo(SqlClientUploadStreamProvider.IdentityIdKey)
    Next file

    Then add the following import statements to the top of the file:

    Imports Krystalware.SlickUpload
    Imports Krystalware.SlickUpload.Status
    Imports Krystalware.SlickUpload.Providers
  •  05-14-2008, 11:43 AM 4053 in reply to 4051

    Re: SlickUpload w/SQL Server 2005

    The first one was missing. Thanks!
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems