Binary file datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Could you help me ??
I have to modify a binary file (containing dates) : I want to access all records ie add,delete,and modify the dates in the binary file.

I do not have experience with C#, so I thought that a datagrid was the right way to do this.
So I did it, load the file in the grid (not so simple for a beginner ), and now i just can't add row to my datagrid (modifying dates is OK), and it's a problem, really need to add "rows" (dates) in my file.
Is it the right way to do this ? should i do it with a dataset ? and then bind the grid to the dataset ? If yes how can I fill a dataset with a binary file ?


Sorry, but I'm a beginner in Visual c#....and Thanks a lot...
 
hi
A dataset would be a better choice for your case, you can load the data
to it the same way you did with the datagrid. Once you fill it you can add
new columns to it for what ever data you want (note you will add columns to
specific table in your dataset).
DataTable US = new DataTable("us");

DataColumn date = new DataColumn("date");
US.Columns.Add(date);
MySet.Tables.Add(US)
///////////////////////////////////////////
Or (in case you already has the datatable object-will be the case with you)
Myset.Tables["US"].Columns.Add(date);

-- you can read more details about datasets on this link

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdatadatasetclasstopic.asp

Hope that would help,


Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top