Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12
  1. #1

    [ASP.NET/C#] salvare il path di una immagine database access

    Salve ragazzi è da un pò che sto impazzendo per capire una questione che mi sta distruggendo...
    Nei vari forum ho trovato tantissime spiegazioni su come ridimensionare immagini e salvarle, sia nella cartella sia nel database...ma non riesco a salvare la path totale in un record...io ho seguito un esempio fatto da Riddick molto bravo e competente...

    Io non capisco però:

    1) Se sbaglio a chiamare i campi (es: NomeTabella,Nome Campo[tipoTesto]), per aggiungere il nome dell'immagine

    2)Seguendo il suo script, una volta salvato il tutto, andando a visualizzare l'immagine non mi fa visualizzare nulla o meglio solo il nome dell'immagine e non l'immagine che a me interessa...

    come faccio?

    Vi chiedo umilmente scusa ma credetemi non so davvero come fare...
    Potete aiutarmi? A me basta anche una guida che spieghi come fare il salvataggio della path e come visualizzare questo salvataggio,l'immagine non il nome...

  2. #2
    ci serve un po di codice per capire cosa stai facendo e trovare un eventuale errore

  3. #3

    [ASP.NET/C#] salvare il path di una immagine database access

    Va bene vi incollo il codice a pezzi per rendervi, spero, tutto un pò più facile...

    codice:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data.OleDb;
    using System.IO;
    using System.Data;
    using System.Drawing.Drawing2D;
    using System.Drawing;
    using System.Drawing.Imaging;
    using System.Globalization;
    
    public partial class insert_image : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    
        bool IsImage(string fileName)
        {
            string ext = Path.GetExtension(fileName).ToLower();
            bool imageFlag = false;
    
            if (ext != null)
            {
                switch (ext)
                {
                    case ".emf": // Enhanced Windows metafile image format
                    case ".exif": // Exchangable Image Format
                    case ".ico": // Windows icon image format (extension .ico)
                    case ".wmf": // Windows metafile image format (extension .wmf)
                    case ".png": // Specifies the W3C Portable Network Graphics image format (extension .png)
                    case ".gif": // Graphics Interchange Format image format (extension .gif)
                    case ".bmp": //Bitmap image format (extension .bmp)
                    case ".tiff": // Tag Image File Format (extension .tif)
                    case ".tif": // Tag Image File Format (extension .tif)
                    case ".jpeg": // Joint Photographic Experts Group image format (extensions .jpg, .jpeg)
                    case ".jpg": imageFlag = true; break; // Joint Photographic Experts Group image format (extensions .jpg, .jpeg)
    
                    default: imageFlag = false; break;  // Not a supported file type.
                } // switch (ext)
            } // if (ext != null)
            else
                imageFlag = false;
    
            return imageFlag;
        } // bool IsImage(string fileName)
    
    
        void CalcolaAspectRatio(double orgWidth, double orgHeight, ref double newWidth, ref double newHeight)
        {
            // Se le dimensioni dell'immagine originale e quelle nuove coincidono non facciamo nulla.
            if ((orgWidth == newWidth) && (orgHeight == newHeight)) return;
    
            // Se le dimensioni originali dell'immagine sono minori di quelle desiderate lasciamo stare.
            // In pratica NON facciamo l'ingrandimento della stessa.
            if ((newWidth > orgWidth) && (newHeight > orgHeight))
            {
                newWidth = orgWidth;
                newHeight = orgHeight;
                return;
            }
    
            double resw = newWidth;
            double resh = newHeight;
            double aw = orgWidth / orgHeight; // fattore larghezza.
            double ah = orgHeight / orgWidth; // fattore altezza.
    
            // Se l'immagine è più piccola del Thumbnail forziamo le dimensioni di 
            // quest'ultimo alle dimensioni dell'immagine.
            if (resw > orgWidth) resw = orgWidth;
            if (resh > orgHeight) resh = orgHeight;
            // Se le dimensioni dell'immagine e del Thumbnail corrispondono non facciamo nulla.
            // quindi se l'immagine è quadrata...
            if (orgWidth != orgHeight)
            {
                // Se l'immagine non è quadrata
                // continuiamo a fare i nostri controlli per calcolarne le 
                // giuste dimensioni e quindi creare la nostra nuova immagine con
                // l'aspectratio corretto.
    
                // Se l'immagine è più larga che alta
                if (orgWidth > orgHeight)
                {
                    // L > H => L = tL
                    // La larghezza del TN sarà quella da noi stabilita
                    // quindi dobbiamo solo assegnarla.
                    resw = resw;
                    // L'altezza del TN invece dovrà essere ricalcolata 
                    // in proporzione alla larghezza dell'immagine originale.
                    // L > H => tH =  tL * (H / L)
                    resh = ah * resw;
                } // if (tmporgWidth > tmporgHeight)
                else
                {
                    // Altrimenti se l'immagine è più alta
                    if (orgWidth < orgHeight)
                    {
                        // L < H => H = tH
                        // L'altezza del TN sarà quella da noi stabilita
                        // quindi dobbiamo solo assegnarla.
                        resh = resh;
                        // La larghezza del TN invece dovrà essere ricalcolata 
                        // in proporzione alla altezza dell'immagine originale.
                        // L < H => tL = tH * (L / H)
                        resw = aw * resh;
                    } // if (orgWidth < orgHeight)
                } // else
            } // if (orgWidth != orgHeight)
    
            // assegnamo i valori calcolati alle nostre due variabili ed il gioco è fatto.	
            newWidth = resw;
            newHeight = resh;
        } // void CalcolaAspectRatio(double orgWidth, double orgHeight, ref double newWidth, ref double newHeight)
    
        void UploadAndResizeAnImage(HttpPostedFile file, double newWidth, double newHeight, string virPath, bool overwrite)
        {
            string destPath = ".";
            double resWidth = 1.0;
            double resHeight = 1.0;
            bool owr = false;
            bool exist = false;
    
            if (virPath != "") destPath = virPath;
            if (newWidth > 0) resWidth = newWidth;
            if (newHeight > 0) resHeight = newHeight;
    
            if (overwrite)
                owr = true;
            else
                owr = false;
    
            int pathCheck = (destPath.Substring(destPath.LastIndexOf('/') + 1)).Length;
            if (pathCheck > 0) destPath += "/";
    
            string fileName = Path.GetFileName(file.FileName);
            string estensione = Path.GetExtension(file.FileName).ToLower();
    
            ImageCodecInfo[] imgCodec = ImageCodecInfo.GetImageEncoders();
            EncoderParameters encPars = new EncoderParameters(2);
            EncoderParameter encPar1 = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L);
            EncoderParameter encPar2 = new EncoderParameter(System.Drawing.Imaging.Encoder.Compression, 100L);
    
            encPars.Param[0] = encPar1;
            encPars.Param[1] = encPar2;
    
            destPath = Server.MapPath(destPath);
            exist = File.Exists(destPath + fileName);
    
            if (!exist && (fileName.Length != 0) || owr)
            {
                if (!IsImage(fileName))
                {
                    if (fileName.Length != 0)
                        Status.Text += "<span style=\"color:Red;\">File '" + fileName + "' is not a valid image format. Upload... Aborted.</span>
    ";
                    return;
                } // if (!IsImage(fileName))
    
    
                using (System.Drawing.Image image = System.Drawing.Image.FromStream(file.InputStream))
                {
                    CalcolaAspectRatio(image.Width, image.Height, ref resWidth, ref resHeight);
    
                    using (Bitmap bitmap = new Bitmap((int)(resWidth), (int)(resHeight)))
                    {
                        string message = "Uploaded";
    
                        bitmap.SetResolution(image.HorizontalResolution, image.VerticalResolution);
    
                        Graphics g = Graphics.FromImage(bitmap);
                        g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                        g.SmoothingMode = SmoothingMode.HighQuality;
                        g.PixelOffsetMode = PixelOffsetMode.HighQuality;
                        g.CompositingQuality = CompositingQuality.HighQuality;
                        g.DrawImage(image, new Rectangle(0, 0, (int)(resWidth), (int)(resHeight)));
                        g.Dispose();
    
                        if (exist && owr)
                        {
                            message = "OverWritted";
                            try
                            {
                                File.Delete(destPath + fileName);
                            }
                            catch (IOException ioe)
                            {
                                message = "<div id=\"error\">Error: " + ioe.GetType().Name + ": The write operation could not be performed because the specified part of the file is locked. Not OverWritted</div>";
                            }
                        } // if (exist && owr)
    
                        if ((estensione == ".jpg") || (estensione == ".jpeg"))
                            bitmap.Save(destPath + fileName, imgCodec[1], encPars);
                        else
                            bitmap.Save(destPath + fileName, image.RawFormat);
    
                        Status.Text += "<span style=\"color:Green;\">File '" + fileName + " &#64; [" + (int)(image.Width) + "px X " + (int)(image.Height) + "px]' " + message + " with this new size [" + (int)(resWidth) + "px X " + (int)(resHeight) + "px]</span>
    ";
                    } // using(Bitmap bitmap = new Bitmap( (int)(resWidth), (int)(resHeight)))
                } // using(Image image = Image.FromFile(file))
            } // if (!exist && (fileName.Length != 0) || owr)
            else
            {
                if (exist && (!owr))
                    Status.Text += "<span style=\"color:Red;\">Error : The file \"<u>" + fileName + "</u>\" already exist... Upload Aborted.</span>
    ";
            }
        } //  void UploadAndResizeAnImage(HttpPostedFile file, double newWidth, double newHeight, string virPath, bool overwrite)
    
        //Inizio Test1 dello script
        int GetUserID()
        {
            string userID = "0";
            // C'è qualcosa nella querystring?
            if (Request.QueryString.Count != 0)
            {
                if (Request.QueryString["userid"] != null)
                    userID = Request.QueryString["userid"];
                else
                    userID = "0";
            }
            return (Convert.ToInt32(userID));
        } 
        //Fine Test1 dello script
    
        void InserisciNomiDeiFilesNelDB_Access(string fileList, char token, string Categoria)
        {
            //string fileName = Server.MapPath("image_insert/") + FileUpload1.FileName;
            // Estraggo dalla lista concatenata i nomi dei file e ne creo un array di stringhe. 
            string[] fileListSplitted = fileList.Split(new Char[] { token });
            // Conto quante stringhe ne sono uscite 
            int fLS = fileListSplitted.Length;
            string fileName = "";
            Status.Text += "
    <hr>Inserimento dei dati nel DataBase : 
    
    ";
            foreach (string s in fileListSplitted)
            {
                if (s != "")
                {
                    fileName = s;
                    // Qui inserite la parte di codice per l'inserimento vero e proprio nel DataBase
                    int userID = GetUserID();
                    string connString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("App_Data/Immagini.mdb") + ";";
                    string sqlString = "INSERT INTO [Privata3] (ID,descrizione,immagine) VALUES ('" + userID + "','" + fileName + "', '" + Categoria + "');";
                    using (System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connString))
                    {
                        conn.Open();
                        System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand(sqlString, conn);
                        try
                        {
                            cmd.ExecuteNonQuery();
                            Status.Text += "<span style=\"color:Green;\">File '" + fileName + "' Inserito correttamente. Ok!
    </span>";
                        }
                        catch (Exception ex)
                        {
                            //  Response.Write("
    Si &egrave; verificato un errore durante l'esecuzione dello script SQL corrente.
    "); 
                            Status.Text += "<span style=\"color:Red;\">Errore : " + ex.Message + "</span>
    ";
                        }
                        finally
                        {
                            conn.Close();
                        }
                    } // using (OleDbConnection conn = new OleDbConnection(connString)) 
                    // Fine codice per inserimento nel DataBase 
    
                }
            } // foreach (string s in fileListSplitted)    
        }

  4. #4
    codice:
    protected void SubmitButton_Click(Object sender, EventArgs e)
        {
            HttpFileCollection uploadedFiles = Request.Files;
            Status.Text = "";
            string ListaNomi = "";
    
            string Categoria = "Default";
            if ((categoria.Text != "") && ((categoria.Text.ToString()).Length > 0)) Categoria = categoria.Text;
    
            for (int i = 0; i < uploadedFiles.Count; i++)
            {
                // Qui sotto definisci le dimensioni che vuoi, la cartella di destinazione
                // e se l'applicazione deve sovrascrivere o no i files preesistenti.
                //
                // UploadAndResizeAnImage(HttpPostedFile file, double newWidth, double newHeight, string virPath, bool overwrite)
                //
                // Quindi  se scrivo come qui sotto :
    
                UploadAndResizeAnImage(uploadedFiles[i], 1024.0, 768.0, "image_insert/", true);
                // significa che voglio che ogni immagine inviata (uploadedFiles[i])
                // venga ridimensionata a 1024x768 (tenendo conto però delle proporzioni originali)
                // e che se il file esiste non deve essere sovrascritto (overwrite = false).
                // Chiaro? Più di così ;)
    
                // Vogliamo pure i Thumbnails??? allora aggiungiamo, sempre in questo ciclo for :
                UploadAndResizeAnImage(uploadedFiles[i], 150.0, 150.0, "image_insert/miniature/", true);
                // significa che voglio che ogni immagine inviata (uploadedFiles[i])
                // venga ridimensionata a 150x150 (tenendo conto però delle proporzioni originali)
                // e che se il file esiste non deve essere sovrascritto (overwrite = false).
                // Creiamo una lista concatenata dei file processati
    
                if (uploadedFiles[i].FileName != "")
                {
                    // Se serve recuperare il nome del file per inserirlo in un DB lo potete recuperare qui.
                    // Consiglio di creare una lista concatenata di stringhe separate da un carattere 
                    //( nel nostro caso  è bene usare un carattere che non è possibile usare nel nome del file cioè "|" )
                   // ListaNomi += Path.GetFileName(uploadedFiles[i].FileName) + "|";
                    ListaNomi += Path.GetExtension(uploadedFiles[i].FileName) + "|";
                }
            }
    
            InserisciNomiDeiFilesNelDB_Access(ListaNomi, '|', Categoria);
        }
    }// protected void SubmitButton_Click(Object sender, EventArgs e)

    codice:
    <%@ Page Language="C#" AutoEventWireup="true"  Debug="true" CodeFile="insert_image.aspx.cs" Inherits="insert_image" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Aggiungi immagini</title>
        <style type="text/css">
            .style1
            {
                width: 800px;
                height: 500px;
                border: 1px solid #000000;
            }
            .style2
            {
                height: 70px;
            }
            .style3
            {
                height: 371px;
            }
            #form1
            {
                height: 269px;
            }
        </style>
    </head>
    <body>
    
        <table cellpadding="0" cellspacing="0" class="style1">
            <tr>
                <td class="style2" colspan="2" valign="top">
                    
    
                    
    
                    Hai la possibilità di aggiungere delle immagini. Ricordiamo che per una migliore 
                    visualizzazzione e gestione delle immagini, il loro peso non dovrà superare i 
                    2MB di memoria</td>
            </tr>
            <tr>
                <td style=" width: 30%;" valign="top">
                </td>
                <td class="style3" valign="top">
                <div align="center"> 
       <h2><asp:Literal id="titletext2" runat="server"/></h2> 
        <form name="inviafile" id="inviafile" enctype="multipart/form-data" runat="server">
    
    	 
    	 Categoria:<asp:TextBox id="categoria" Columns="30" runat="Server"/>
    
    
    	 
         Select File01: 
         <input id="File1" type="file" runat="Server"/>
     
         Select File02: 
         <input id="File2" type="file" runat="Server"/>
     
         Select File03: 
         <input id="File3" type="file" runat="Server"/>
     
         Select File04: 
         <input id="File4" type="file" runat="Server"/>
     
         Select File05: 
         <input id="File5" type="file" runat="Server"/>
     
         Select File06: 
         <input id="File6" type="file" runat="Server"/>
     
         Select File07: 
         <input id="File7" type="file" runat="Server"/>
     
         Select File08: 
         <input id="File8" type="file" runat="Server"/>
     
         Select File09: 
         <input id="File9" type="file" runat="Server"/>
     
         Select File10: 
         <input id="File10" type="file" runat="Server"/>
    
     
         <div align="center"><input id="Submit1" type="submit" value="Upload Files" runat="Server" onserverclick="SubmitButton_Click"/></div> 
         
     
         <asp:Label id="Status" runat="server"></asp:Label>        
        </form> 
       </div> 
    
                </td>
            </tr>
        </table>
    
    </body>
    </html>

  5. #5
    codice:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Net;
    using System.IO;
    using System.Data.OleDb;
    using System.Data;
    using System.Drawing.Drawing2D;
    using System.Drawing;
    using System.Drawing.Imaging;
    
    public partial class _Default : System.Web.UI.Page 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
        Seleziona_Record();
        }
    //Estrae i record dal database
        public void Seleziona_Record()
        {
            //Apro la connessione al db, in questo caso   mySQL
            String ConnString = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + Server.MapPath("App_Data/Immagini.mdb");
            //OdbcConnection ob = new OdbcConnection("Driver={MySQL};Database=db;UID=user;PWD=pass;");
            //String sql = "select * from TABELLA";
            //String sql = "SELECT descrizione, immagine FROM Privata3";
            String sql = "SELECT * FROM Privata3";
            OleDbConnection cn = new OleDbConnection(ConnString);
            //OdbcDataAdapter Com = new OdbcDataAdapter(sql,ob);
            OleDbDataAdapter Com = new OleDbDataAdapter(sql, cn);
            DataSet ds = new DataSet();
            //Calcolo i record da estrarre e riempio   il dataset
            int startRecord = (int.Parse(Pagina.Value) - 1) * int.Parse(Record_Max.Value);
            Com.Fill(ds, startRecord, int.Parse(Record_Max.Value), "Tabella");
    
            //datalist1.DataSource = ds.Tables[0];
            //StreamReader sr = new StreamReader(Server.MapPath("image_insert/"));
            Grid.DataSource = ds.Tables[0];
            Grid.DataBind();
            //Conta i numero di record Totali
            OleDbCommand myCmd = new OleDbCommand("SELECT Count(*) FROM Privata3", cn);
            cn.Open();
            Record_Tot.Value = myCmd.ExecuteScalar().ToString();
            cn.Close();
    
            //Controllo i Link
            if ((int.Parse(Pagina.Value) - 1) <= 0)
            {
                Prev.Enabled = false;
            }
            else
            {
                Prev.Enabled = true;
            }
            if ((int.Parse(Pagina.Value) * int.Parse(Record_Max.Value)) >= int.Parse(Record_Tot.Value))
            {
                Next.Enabled = false;
            }
            else
            {
                Next.Enabled = true;
            }
        }
            //Controlla che link ha sollevato l'evento e aumenta o diminuisce la pagina corrente
       public void Paginazione(object sender, EventArgs e){
            if(((LinkButton)sender).ID=="Prev"){
                if((int.Parse(Pagina.Value)-1)>=0){
                    Pagina.Value = (int.Parse(Pagina.Value)-1).ToString() ;
                }
            }
            else if(((LinkButton)sender).ID=="Next"){
                if((int.Parse(Pagina.Value)*int.Parse(Record_Max.Value))<int.Parse(Record_Tot.Value)){
                    Pagina.Value = (int.Parse(Pagina.Value)+1).ToString() ;
                }
            }
            Seleziona_Record();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
    
        }
    }

  6. #6
    Mentre nella Default.aspx c'è questo...

    codice:
    <%@ Page Language="C#" AutoEventWireup="true" Debug="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Prova di area privata</title>
        <style type="text/css">
            .style1
            {
                width: 800px;
                height: 600px;
                border: 1px solid #000000;
            }
            .style2
            {
                height: 30px;
            }
            .style3
            {
                width: 58px;
            }
            .style4
            {
                height: 275px;
            }
            .style6
            {
                height: 3px;
            }
            .style7
            {
                width: 167px;
                height: 80px;
            }
            .style8
            {
                width: 162px;
                height: 80px;
            }
            .style9
            {
                height: 80px;
            }
        </style>
    </head>
    <body>
    
        <form id="form1" runat="server">
    
        <table cellpadding="0" cellspacing="0" class="style1">
            <tr>
                <td class="style2" colspan="5" valign="top">
                    Questa è una prova di area privata</td>
            </tr>
            <tr>
                <td class="style3" rowspan="3" valign="top">
                    </td>
                <td valign="top" class="style7">
                
                    <div style="height: 139px; width: 183px;" > 
                    <asp:DataList ID="datalist1" DataKeyField="ID" DataSourceID="AccessDataSource1" 
                            runat="server" BackColor="#CCCCCC" Font-Bold="False" Font-Italic="False" 
                            Font-Names="Tahoma" Font-Overline="False" Font-Size="Small" 
                            Font-Strikeout="False" Font-Underline="False" ForeColor="Black" Height="263px" 
                            HorizontalAlign="Center" Width="138px" BorderColor="#999999" 
                            BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" 
                            GridLines="Both" RepeatColumns="1">
                        <FooterStyle BackColor="#CCCCCC" />
                        <ItemStyle BackColor="White" />
                        <SelectedItemStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                        <ItemTemplate>
                            ID:
                            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                            
    
                            descrizione:
                            <asp:Image ID="descrizioneLabel" runat="server" 
                                Text='<%# Eval("descrizione") %>' />
                            
    
                            immagine:
                            <asp:Label ID="immagineLabel" runat="server" Text='<%# Eval("immagine") %>' />
                            
    
                            
    
                        </ItemTemplate>
                    </asp:DataList>                
                        
                        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
                            DataFile="~/App_Data/Immagini.mdb" 
                            SelectCommand="SELECT * FROM [Privata3] WHERE ([ID] = 1)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="datalist1" Name="ID" 
                                    PropertyName="SelectedValue" Type="Int32" />
                            </SelectParameters>
                        </asp:AccessDataSource>
                        
                    </div>
                
                </td>
                <td valign="top" class="style8">
                
                    <div style="height: 140px">
                    <input type="hidden" id="Record_Max" value="4" runat="server">
    <input type="hidden" id="Pagina" value="1" runat="server">
    <input type="hidden" id="Record_Tot" runat="server">
    <asp:DataList id="Grid" runat="server" repeatlayout="table" DataKeyField="ID">
    <ItemTemplate>
    <%# DataBinder.Eval(Container.DataItem, "ID") %> -
    <%#DataBinder.Eval(Container.DataItem,"descrizione") %>
    
    </ItemTemplate>
    </ASP:DataList>
    <asp:LinkButton id="Prev" Text="<< Prev" OnClick="Paginazione" runat="server" /> 
    <asp:LinkButton id="Next" Text="Next >>" OnClick="Paginazione" runat="server" />
                    </div>
                
                </td>
                <td class="style9" valign="top">
                    <div style="height: 139px">
                    </div>
                </td>
                <td class="style9" valign="top">
                    <div style="height: 136px">
                    </div>
                </td>
            </tr>
            <tr>
                <td class="style4" valign="top" colspan="2">
                </td>
                <td class="style4" valign="top" colspan="2">
                </td>
            </tr>
            <tr>
                <td valign="top" class="style6" colspan="4">
                    Area privata</td>
            </tr>
        </table>
    
        </form>
    
    </body>
    </html>
    Con molta umiltà vi chiedo scusa per il disturbo che vi sto creando...

  7. #7
    Moderatore di ASP.net L'avatar di djciko
    Registrato dal
    Nov 2002
    Messaggi
    6,887
    Originariamente inviato da Gluck74
    ci serve un po' di codice per capire cosa stai facendo e trovare un eventuale errore

    Con molta umiltà vi chiedo scusa per il disturbo che vi sto creando...
    piuttosto chiedi scusa per non aver usato i tag [CODE] !

  8. #8

    [ASP.NET/C#] salvare il path di una immagine database access

    o mio dio è vero scusate...mannaggia

  9. #9

    [ASP.NET/C#] salvare il path di una immagine database access

    Ciao volovo chiederti se fossi riuscito a capirci qualcosa...perchè io ora mi sono totalmente bloccato...nella Default.aspx non riesco a fare più nulla...

  10. #10
    c'è un po di confuzione nei file che mi hai mandato.

    comunque.... nella sub
    codice:
    void InserisciNomiDeiFilesNelDB_Access(string fileList, char token, string Categoria)
    controlla la riga
    codice:
    string sqlString = "INSERT INTO [Privata3] (ID,descrizione,immagine) VALUES ('" + userID + "','" + fileName + "', '" + Categoria + "');";
    non mi sembra che stai salvando i dati giusti

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.