Jump to content
» Pat

Anyone good at .NET?

Recommended Posts

Posted

In case we have someone that's good at .NET (Visual Basic).... I need you. qq......

I hate this job.... qq....

Posted

ya sup

Posted

...o VB.NET? fu pat i use C#.NET fu fu fu

Posted

VB SUCKS

Posted
VB SUCKS

I DIDN'T CHOOSE TO CODE THIS SHIT IN VB.

Posted

I only know how to use shell and download virusus on hotel computers

-gg

If it helps, on a computer that has restrictions u can open VB by opening a word document and pressnig alt+f8, and use shell to open downloaded files (only certain files, sometimes u dont gotta be a admin)

Posted
and download virusus on hotel computers

Why the hell would you...?

Posted
I only know how to use shell and download virusus on hotel computers

-gg

If it helps, on a computer that has restrictions u can open VB by opening a word document and pressnig alt+f8, and use shell to open downloaded files (only certain files, sometimes u dont gotta be a admin)

GTFO SKRIPT KIDDIE

pat, wut do u nid help with? u nvr told. My VB knowledge is limited but I know .NET in general so eh. Plus I can just translate C# to VB

Posted

  • Load xml into dataset
  • Choose table
  • Choose column
  • Convert to csv

:/

Actually I'm almost done I just need the xml->csv conversation. [:

It's just some 'oh-my-god-we-can't-just-let-you-sit-on-a-chair-for-9-hours-everyday-a-whole-year-long-let's-see-I-bet-we'll-find-something-really-idiotic-to-code-for-you' task I was assigned @ work.

Posted

What's so hard about conversion to CSV? You have the tables and columns loaded, just output them?

http://en.wikipedia.org/wiki/Comma-separated_values

A quick google search shows that .NET doesn't have any native CSV implementations, so just make one yourself.

If you want me to help you with the CSV conversion framework or w/e post some of the specifics of what the xml file looks like, as xml files don't have "tables" and "columns". I'm thinking you have an SQL-like database stored in an xml format? If so, post what it looks like and how you're parsing and loading it.

Then I can help you on how to start writing something to output it in different formats.

CSV itself is rather easy, except for stuff like escaping commas, newlines, quotes etc.

Posted
I'm thinking you have an SQL-like database stored in an xml format? If so, post what it looks like and how you're parsing and loading it.

Kind of. I'll provide some info once I'm at work again. Tuesday probably.

& I'm just using DataSet.ReadXML() so ya. I'll post some info.

Posted

i can do vb6 and c++, c#, also d3d hook.

if you need helps with whatever pm me.

i will require payment in.....

noods.

Posted

OMG U DO D3D HOOK IT WILL HALP SO MUCH FOR READING DATASETS OMG PLZPLZ PLZ TELL MI HOW U DO D3D HOOK PLS

Posted

noods...

pls nick, i need noods....

many noods.....

i do d3d for warrock/combat arms/css/crossfire

Posted

letmegooglethatforyou.com

Posted
Why the hell would you...?

Cuz theyre restrictions are so pissing off and nets so slow, but so expensive :P

Posted

Sigh. Anyhow, pat, if you can, I strongly advise you to stay clear of the DataSet class and make something real. I personally used .NET's xml classes to load the content and parsed it myself, storing it in my *own* variables and not some abstract DataSet crap.

That way you can define a struct, for example something like:

public class MyDatabase
{
    public List<TableStruct> Tables;
    
    public MyDatabase()
    {
        this.Tables = new List<TableStruct>();
    }
    
    public void AddTable(TableStruct table)
    {
        this.Tables.Add(table);
    }
}

public struct TableStruct
{
    public List<ColumnStruct> Columns;
    public List<RowStruct> Rows;
    
    public TableStruct(int numCols)
    {
        this.Columns = new List<ColumnStruct>(numCols);
        this.Rows = new List<RowStruct>();
    }
}

public struct ColumnStruct
{
    public string Name;
    public ColumnType Type;
    public int MaxLength;
    
    public ColumnStruct(string name, ColumnType type, int length)
    {
        this.Name = name;
        this.Type = type;
        this.MaxLength = length;
    }
}

public struct RowStruct
{
    public List<object> Fields;
    
    public RowStruct(params object[] data)
    {
        this.Fields = new List<object>();
        this.Fields.AddRange(data);
    }
}

public enum ColumnType
{
    TINYINT,
    SMALLINT,
    MEDIUMINT,
    INT,
    BIGINT,
    FLOAT,
    DOUBLE,
    DOUBLE_PRECISION,
    REAL,
    DECIMAL,
    NUMERIC,
    DATE,
    DATETIME,
    TIMESTAMP,
    TIME,
    YEAR,
    CHAR,
    VARCHAR,
    TINYBLOB,
    TINYTEXT,
    BLOB,
    TEXT,
    MEDIUMBLOB,
    MEDIUMTEXT,
    LONGBLOB,
    LONGTEXT,
    ENUM,
    SET
}

private static MyDatabase db;

static void Main(string[] args)
{
    db = new MyDatabase();
    
    // Then do something like this in a foreach loop through your xml content:
    TableStruct curtab = new TableStruct(2);
    curtab.Columns.Add(new ColumnStruct("id", ColumnType.SMALLINT, 65535));
    curtab.Columns.Add(new ColumnStruct("str", ColumnType.VARCHAR, 255));
    curtab.Rows.Add(new RowStruct(0, "hello"));
    curtab.Rows.Add(new RowStruct(1, "world"));
    curtab.Rows.Add(new RowStruct(2, "lol"));
    db.AddTable(curtab);
}

Then you'd have something like:

DATABASE
|
|
|- TABLE
|-------| SMALLINT(65535) id | VARCHAR(255) str |
|       |--------------------|------------------|
|       | 0                  | hello            |
|       | 1                  | world            |
|       | 2                  | lol              |
|       |--------------------|------------------|
|
-

Of course, you could add more tables onto the end with MyDatabase.AddTable(), until you have all the tables with their respective data loaded into the MyDatabase.

After that you can do something like:

StringBuilder outstr = new StringBuilder();

foreach (TableStruct tab in db.Tables)
{
    foreach (RowStruct row in tab.Rows)
    {
        foreach (object ob in row.Fields)
        {
            outstr.Append(ob.ToString());
            outstr.Append(',');
        }
        outstr.Append("\n");
    }
    oustr.Append("----\n");
}

Which would produce something like:

0,hello
1,world
2,lol
----

Of course the exact implementation would be a lot different, and you'd have to escape the strings and whatnot. Still it's just a _general_ idea on how I'd do it.

Note: Wrote all this on the posting page, so none of it is tested. Not sure how good it'll work lol.

Posted

Oh and if you want to do it with something similar to my way, I can help you with outputting it to csv and escaping the strings and stuff; if you tell me the specifics of the CSV format you're saving into / the XML you're loading.

Sorry for double posting but you've read my last post so I doubt you'll read it again if I just edit it.

Guest
This topic is now closed to further replies.


×
×
  • Create New...