0

Hi ,

i need to add values in my Grid-View at Run time and save it to the database.i am displaying a particular folder filenames in gridview now after displaying need to add two columns and insert values at runtime in it and then save it to the database.i tried various things like by creating a function and calling and inserting values but at run-time this Does not work. i am novice in this field and Don't know much about this ..please help.

code for displaying folder filenames :

FolderBrowserDialog folderDlg = new FolderBrowserDialog();
              folderDlg.ShowNewFolderButton = true;
            // Show the FolderBrowserDialog.
             DialogResult result = folderDlg.ShowDialog();
             String[] files = Directory.GetFiles(@"C:\Users\LENOVO\Desktop\RemotePlay");
            DataTable table = new DataTable();
            table.Columns.Add("File Name");
            table.Columns.Add("Sequence");
            table.Columns.Add("Delay");
            for (int i = 0; i < files.Length; i++)
            {
                FileInfo file = new FileInfo(files[i]);
                table.Rows.Add(file.Name);
            }
             dataGridView1.DataSource = table;
2
Contributors
3
Replies
14
Views
10 Months
Discussion Span
Last Post by ddanbe
0

You telling us "it does not work" does not help us much in trying to solve your problem.
Please be more specific and verbose about WHAT "does not work"

0

ddanbe i resolved my question myself but now Another problem with datatype has occurred. i have this field in database called Delay its related to playing/displaying image or video files. i want to set datatype of that field so far int,varchar not working its storing Zero(0) value instead of user inputted data.so what datatype must be used ?

1

You should have posted this question in a new thread.
Look in the documentation for your SQL brand, in MySQL you could use the blob datatype.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.