This is a migrated thread and some comments may be shown as answers.

RadUpload into SQL Server - How do I add a progress bar please?

1 Answer 233 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 2
Richard asked on 18 Feb 2009, 12:03 PM
Using ASPNET AJAX Q3 2008 - How do I add an Rad Progress bar when I am inserting the selected file into a SQL DB varbinary please?
I have dragged and dropped the following items on to a blank page:
 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />

 

 

<telerik:RadUpload ID="ruFile" runat="server" ControlObjectsVisibility="None" MaxFileInputsCount="1" Skin="Default" />  

 

 

<telerik:RadProgressArea ID="RadProgressArea1" runat="server" />

 

 

<telerik:RadProgressManager ID="RadProgressManager1" runat="server" />

 

<

 

asp:Button ID="btnNext" runat="server" Text="Next" />

---------------------  On clicking "Next", this code is executed :

Public Sub InsertToSQL(ByVal inFile As UploadedFile)  

 

 

  

 

Dim Filedata As Byte()
Dim Filesize As Integer

 

 Filesize = inFile.InputStream.Length

 

 

 

inFile.InputStream.Read(Filedata, 0, Filesize)
Dim db As Database = DatabaseFactory.CreateDatabase("mySQLString")

 

 

 

 

Dim cmd As DbCommand = db.GetStoredProcCommand("spInsertDoc")

 

 

 cmd.CommandTimeout = 60

 

 

db.AddParameter(cmd,

 

 

 

 

"@filedata", SqlDbType.Binary,Filedata.Length, ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), Nothing, DataRowVersion.Current, Filedata)
db.ExecuteNonQuery(cmd)

 

 

End Sub

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 19 Feb 2009, 12:03 PM
Hello Richard Leung,


When you have RadProgressArea, RadUpload and RadProgressManager on the page, if the request is big enough they will automatically track and display the upload progress for you. However, keep in mind that RadProgressArea shows only the upload to the server. If you want to use RadProgressArea to display an action that is not in concern with the upload, you should consider using custom progress monitoring as it is shown in this demo . I would suggest you reading this article as well.

As I understand your question, you want to use RadProgressArea to display the proccess of saving an uploaded file into the database. As far as i know ADO.NET does not provide methods for tracking the save-to-db progress, so you would not be able custom monitor it is using RadProgressArea.

Regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Upload (Obsolete)
Asked by
Richard
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Share this question
or