C # .NET - How to upload a file to a DataSet?

I need to upload a file (usually ASCII) to DataSet. How can i do this? What data types should I use for my columns?

Thanks.

+3
source share
3 answers

you can use byte [] for type,

Maybe a DataTable might be useful for you

DataTable dt = new DataTable("files");
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("size", typeof(int));
dt.Columns.Add("content", typeof(byte[]));
+3
source

Not sure if this is what you are looking for, but you can find a sample here:

Fill a DataSet from delimited text files

+3
source

DataSet - , . , .. .

, , , , . , .

Better type your data and then transfer the raw dust to the DataSet using the extension method. XML children do the same for XML files (which is just like nuts).

+2
source

Source: https://habr.com/ru/post/1706358/


All Articles