Update

Thread is closed for posting
4 posts, 0 answers
  1. khansa
    khansa avatar
    8 posts
    Member since:
    Jul 2010

    Posted 01 May 2011 Link to this post

    Hi.

    I save 3 images in the folder and images name in the database. Like this i added 3 records. Here is my code

      foreach (UploadedFile f in RadUpload1.UploadedFiles)
                {
                    string strfolder;
                    dataquery dq = new dataquery();
                    string strsql;
                    strfolder = Server.MapPath("../noon");
                    f.SaveAs(strfolder + "\\" + f.GetName(), true);
                    strsql = "insert into images(imid,imagname) values('1','" + f.GetName() + "')";
                    dq.ExecuteQuery(strsql);
                }
    Now i want to update my record and images. but i do't know how to show images in the Radupload control or then i what to write code for update.

    Please can you see my above code and help me to write update code and select record images in the Radupload. I am not using Radgrid.

    Thank you so much for help.

     

     

     

     

     

     

     

  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 03 May 2011 Link to this post

    Hi khansa,

    I have just answered to the same question in another thread. Here is my answer.

    The RadUpload control can upload and validate files. My suggestion is to select all of the names from the DB (e.g. SELECT imageID, imangeName FROM images) and display them to the user.
    After clicking on the image, the RadUpload control should appear. After a postback the file is saved into the folder. The name into the DB is updated(e.g. UPDATE images SET imageName= "newImageName" WHERE imageID = "ID").

    Please consult with the following demo.

    Kind regards,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Adel
    Adel avatar
    1 posts
    Member since:
    Mar 2011

    Posted 03 May 2011 Link to this post

    Dear Team.

    In the refered demo Upload control uploading only one Image but in my question there is ( Multiple  Uploaded Files -- InputStream) Loop and then insert statement. Loop is uploading many images.... So refered demo I already impliment so where in my project. Here is my first code.
    foreach (UploadedFile f in RadUpload1.UploadedFiles).....
    strsql = "insert into images(imid,imagname) values('1','" + f.GetName() + "')";
    ...

    I can insert many images and it working correct by I am unable to delete and Update there images.

    I think i should do like this
                    foreach (UploadedFile f in RadUpload1.UploadedFiles)
                    dataquery dq = new dataquery();
                    string strsql;
                    strfolder = Server.MapPath("../noon");
                    f.SaveAs(strfolder + "\\" + f.GetName(), true);

                    strsql = "Update images imagname='" + f.GetName() + " where id=1 ";

                                     )
    I Know above code is wrong because it is again uploading old images to server Folder "noon"
    Also i dont know how to select insert record and show in the upload control.

    In Other hand Here is link http://www.telerik.com/help/aspnet-ajax/upload_raduploadmanipulatingfiles.html
    Please can you assist me how to write delete and Update querry.
    I will be thankfull to you.
    Thanks.
  5. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 04 May 2011 Link to this post

    Hi Adel,

    We noticed that there is another support ticket regarding the same issue. To keep communication consistent and avoid duplication we will close this ticket.

    Regards,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top