Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/06/2013, 11:30
SoVre
 
Fecha de Ingreso: abril-2012
Mensajes: 17
Antigüedad: 12 años, 1 mes
Puntos: 0
no se puede convertir implicitamente int en dataset.datatable

Estoy haciendo un boton que lea los archivos de una serie de carpetas y luego guarde la informacion de estos en una tabla.
Tengo una tabla videos donde se almacenan estos datos, la cual tiene un query "insert" en el tableAdapter.

Este es mi boton:
Código:
private void actualizar_Click(object sender, EventArgs e)
        {
            Program.listFiles();
        }
Este es mi codigo en program.cs:
Código:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Text;
using System.IO;
using System.Data;


namespace WindowsFormsApplication1
{
    static class Program
    {
        /// <summary>
        /// Punto de entrada principal para la aplicación.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

        public static void listFiles()
        {
            try
            {
                DirectoryInfo directory = new DirectoryInfo(@"D:\Jueg");
                FileInfo[] files = directory.GetFiles("*.*");
                 for (int i = 0; i < files.Length; i++)
                {
                    string nombre = ((FileInfo)files[i]).FullName;
                    string direccion = ((FileInfo)files[i]).DirectoryName;
                    string fecha = ((FileInfo)files[i]).CreationTime.ToString();
                    
                    canal4videosDataSetTableAdapters.videoTableAdapter videoTableAdapter1;
                    videoTableAdapter1 = new canal4videosDataSetTableAdapters.videoTableAdapter();

                    canal4videosDataSet.videoDataTable newvideoTable;
                    newvideoTable = videoTableAdapter1.insertvideos(nombre, fecha, direccion);
                }                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
    }
}
En el texto marcado en rojo me tira este error:

Error 1 No se puede convertir implícitamente el tipo 'int' en 'WindowsFormsApplication1.canal4videosDataSet.vide oDataTable' C:\Documents and Settings\Ale\mis documentos\visual studio 2010\Projects\explorador\explorador\Program.cs 44 37 explorador

Exactamente cual es el problema? alguien podria ayudarme?