Click to See Complete Forum and Search --> : Set cat = CreateObject("ADOX.Catalog") in C# ??


JohanJohansson
October 23rd, 2002, 05:32 PM
What do I do to convert this VB-code to C# ?

Example 1:

Dim cat As New ADOX.Catalog



Example 2:

Set cat = CreateObject("ADOX.Catalog")
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb"

Set tbl = CreateObject("ADOX.Table")
tbl.Name = "tBeispielTabelle"
cat.Tables.Append tbl



Regards
Johan

WillemM
October 31st, 2002, 04:48 AM
this is probably the code you need:

ADOX.Catalog cat = new ADOX.Catalog();

Example 2:

cat = new ADOX.Catalog();

cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb";

ADOX.Table tbl = new ADOX.Table();

tbl.Name = "ExampleTable";
cat.Tables.Append(tbl);