Voor Mij (RSS)

Troep voor mij

My first open source project Office Open XML C# Library

Hey all,

Well today i finally started my own Open source project witch is called "Office Open XML C# Library".

The purpose of this project is to create a Library witch will allow c#(.Net 2.0) programmers a easy interface with the new File format of Office 2007.

As a start i created a basic interface for word documents (*.docx) witch is in the Alpha fase. This interface is not great Yet but it will to some of the basic thinks like reading and writing :).

In the end the Library will support all the Open Xml files like "Docx", "xlsx" and the rest of it all.

One of the problems with the first alfa is you can't create a docx from scratch yet.

Well i hope some people think this is a good idee :D.
If to please visit http://officeopenxml.sourceforge.net and try it out

Happy Netting,
Warnar

Object to DataTable

Hi all, Did you ever had the problem that u just wanted your object in a datatable and didn't wane hardcode the datatable if so this may help:

#region ObjectArrayToDataTable
        internal static DataTable ObjectArrayToDataTable(object[] obj, Type type)
        {
            return ObjectArrayToDataTable(obj, type, null);
        }
        internal static DataTable ObjectArrayToDataTable(object[] obj, Type type, DataColumn[] extra)
        {
            DataTable dt = new DataTable();

            foreach (PropertyInfo pi in type.GetProperties())
            {
                if (pi.PropertyType.IsPrimitive || pi.PropertyType == typeof(string) || pi.PropertyType == typeof(DateTime))
                {
                    dt.Columns.Add(pi.Name, pi.PropertyType);
                }
            }

            if (extra != null)
            {
                foreach (DataColumn c in extra)
                {
                    if (dt.Columns.Contains(c.ColumnName))
                        dt.Columns.Remove(c.ColumnName);
                    dt.Columns.Add(c);
                }
            }

            foreach (object k in obj)
            {
                DataRow dr = dt.NewRow();
                foreach (PropertyInfo pi in type.GetProperties())
                {
                    if (pi.PropertyType.IsPrimitive || pi.PropertyType == typeof(string) || pi.PropertyType == typeof(DateTime))
                    {
                        dr[pi.Name] = pi.GetValue(k, null);
                    }
                }
                dt.Rows.Add(dr);
            }

            return dt;
        }
        #endregion

I wish you all happy netting!

AAAAh I'm going crazy Fixing this PC

Hey all,

I'm bizzy trying to fix a pc for a friend of me but i can't find the problem with the PC it hangs after playing like 4 minutes solitair or doing word for that time.
It aint the processor it's new and i allready tested it with a working pc.
It aint the Motherboard also tested that.
It aint the memory because i tryed serveral working RAM memory.
It aint the Harddisk tryed 3 diffrend HDD's.
It aint the DVD player because the error is there also if it is unplugged.
It aint the floppydrive because the error is there also if it is unplugged.
It aint the powersupply tryed 2 diffrend kinds.
It aint the graphics cart tryed to 2 diffrend kinds of PCI and one AGP.

Here is some more info about the PC:
Intel Celeron 2.4GHz (Boxed)
JetWay P4X400DBZ
Seagate Baracuda 30GB
RICOH MP5240A DVD+RW/+R
TOPELITE 400 MAX (by CWT) Model NO: ISO-230
Elixir 256MB DDR-400MHz-CL3
S3 Trio64V2/DX
Windows XP
Symantec Antivirus Corp 9

Hope someone has a clou because i'm getting onto the point of trowing it out of the window !!

Good Luck To All