Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Extending data warehouse using .Net
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 5th February 21:29
alexander yushchenko
External User
 
Posts: 1
Default Extending data warehouse using .Net



Hello!

(CS2002 + SP3 + FP1)

I tried to use code examples in VB Script and it worked.


I use the following code: (server and database names and password
has been changed):


using System;
using System.Data.OleDb;
namespace UpdateDWScheme
{
class Class1
{
[STAThread]
static void Main()
{
OleDbConnection c = new OleDbConnection
("Provider=commerce.dso.1;Data Source=mscop://InProcConnect/Server=serv:
Catalog=DWSchemaatabase=site_dw:user=saassword =pass:FastLoad=True");
c.Open();

//Everything else goes here
}
}
}


After calling "c.Open();" the connection is opened and closed
immediately after it, with no exceptions.

What's the matter? Why doesn't it work?

--
Yours faithfully,
Alexander Yushchenko
  Reply With Quote


  sponsored links


2 5th February 21:29
max akbar
External User
 
Posts: 1
Default Extending data warehouse using .Net



Don't use OLEDB use ADO.

Here is a quick sample:

ADODB.Connection oCon= new ConnectionClass();
ADODB.Record rec = new RecordClass();

oCon.Open("URL=mscop://InProcConnect/server="+server+":database="+database+":Catalog=DW Schema:
user="+user+"assword="+password+":FastLoad=True" , string.Empty,
string.Empty, 0);

rec.Open("ClassNames", oCon, ConnectModeEnum.adModeReadWrite,
RecordCreateOptionsEnum.adCreateOverwrite,
RecordOpenOptionsEnum.adOpenRecordUnspecified, string.Empty, string.Empty);

foreach(string name in (System.Array)rec.Fields["ClassNames"].Value)
{
System.Diagnostics.Debug.WriteLine(name);
}

Good luck,
-Max
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666